Created
December 30, 2012 14:10
-
-
Save shiwano/4412975 to your computer and use it in GitHub Desktop.
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
(function () { | |
function sleep(time) { | |
var d1 = new Date().getTime(); | |
var d2 = new Date().getTime(); | |
while(d2 < d1 + time) { | |
d2 = new Date().getTime(); | |
} | |
return; | |
} | |
var count = 0; | |
setInterval(function () { | |
sleep(1000); | |
count += 1; | |
console.log(count); | |
}, 10); | |
return; | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment