function loop(max) { var i = 0; while (i < max) { i = i + 1; } return i; }