Google is launching a new language, promising that it has better performance, but how can I evaluate performance in Darth's source code?
Take for example the sun flower "drawFrame method:
// Draw the complete figure for the current number of seeds. void drawFrame() { ctx.clearRect(0, 0, MAX_D, MAX_D); for (var i=0; i<seeds; i++) { var theta = i * PI2 / PHI; var r = Math.sqrt(i) * SCALE_FACTOR; var x = xc + r * Math.cos(theta); var y = yc - r * Math.sin(theta); drawSeed(x,y); } }
If we have many seeds , can we add instructions for evaluating elapsed time in for ?
Junior M
source share