Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Javascript Sleep

DZone's Guide to

Javascript Sleep

·
Free Resource
Imitate sleep in javascript


function wait(msecs)
{
var start = new Date().getTime();
var cur = start
while(cur - start < msecs)
{
cur = new Date().getTime();
}
} 
Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}