Skip to content

Instantly share code, notes, and snippets.

@parambirs
Created January 6, 2016 12:24
Show Gist options
  • Select an option

  • Save parambirs/be963958b688f20cbf98 to your computer and use it in GitHub Desktop.

Select an option

Save parambirs/be963958b688f20cbf98 to your computer and use it in GitHub Desktop.
Sleep in JS
function sleep(milliSeconds) {
var startTime = new Date().getTime();
while (new Date().getTime() < startTime + milliSeconds);
}
sleep(10000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment