Last active
December 10, 2016 12:34
-
-
Save xk/b06fd049fc4b8b7000f9a7addfece2e0 to your computer and use it in GitHub Desktop.
JavaScript execution wow and flutter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 2016-11-29 jorge@jorgechamorro.com | |
// JavaScript execution wow and flutter | |
var MAX_ms= -1; | |
var r, now, ctr, str; | |
var MAX_ctr= -1; | |
var MIN_ctr= 10e9; | |
function sync (now,r) { | |
now= Date.now()+ 1; | |
while ( now > ( r= Date.now() ) ) ; | |
return r; | |
} | |
do { | |
ctr= 0, now= sync(); | |
do ctr+= 1; while ( now === ( r= Date.now() ) ); | |
r= r-now; | |
str= ''; | |
if (r > MAX_ms) MAX_ms= r; | |
if (ctr < MIN_ctr) MIN_ctr= ctr; | |
if (ctr > MAX_ctr) MAX_ctr= ctr; | |
str= 'MAX_ms:'+ MAX_ms+ ' MIN_ctr:'+ MIN_ctr+ ' MAX_ctr:'+ MAX_ctr+ '\r'; | |
process.stdout.write(str); | |
} while (1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment