JavaScript Sleep

10年前
function sleep(millisecond)  {   var now = new Date();   var outTime = now.getTime() + millisecond;   while (true)   {    now = new Date();    if (now.getTime() > outTime)    {     return;    }   }  }      function Test()  {   alert("sleep");   sleep(3000);   alert("continue");  }