Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save yoshifumi0521/5494767 to your computer and use it in GitHub Desktop.
Save yoshifumi0521/5494767 to your computer and use it in GitHub Desktop.
javascriptで時間をスリープする処理。
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