JavaScript Sleep
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"); }