js:
function sleep(numberMillis) {
var now = new Date();
var exitTime = now.getTime() + numberMillis;
while (true) {
now = new Date();
if (now.getTime() > exitTime)
return;
}
}
定时操作:
setTimeout(fun,2000);//2000是2秒
WinForm:
System.Threading.Thread.Sleep(10000);//10秒