Skip to content

$.sleep()

Arthur Guiot edited this page Sep 9, 2017 · 1 revision

How it works?

This function is simple, you just need to tell it how many milliseconds you want JavaScript to sleep.

In other words, if you want to trigger some stuff in the main thread (without using setTimeout()), this function will be useful.

How to use it?

Example

$.sleep(1000);
alert("I'm 1 second late!");
Clone this wiki locally