Home  >  Article  >  Web Front-end  >  js Date custom function delays script execution_javascript skills

js Date custom function delays script execution_javascript skills

WBOY
WBOYOriginal
2016-05-16 18:32:531110browse
复制代码 代码如下:

function delay(numberMillis){
var now = new Date();
var exitTime = now.getTime() numberMillis;
while(true){
now = new Date();
if(now.getTime() > exitTime)
return;
}
}
document.write("");
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn