Created
May 1, 2013 11:10
-
-
Save yoshifumi0521/5494767 to your computer and use it in GitHub Desktop.
javascriptで時間をスリープする処理。
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 Sleep(T){ | |
var d1 = new Date().getTime(); | |
var d2 = new Date().getTime(); | |
while( d2 < d1 + 1000*T ){ | |
d2=new Date().getTime(); | |
} | |
return; | |
} | |
//1秒待つ | |
Sleep( 1 ); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment