Skip to content

setTimeout Execution Time

View on Twitter

💡 A common misconception of setTimeout is:
"Execute this function in (exactly) x ms"

When in reality, you should think of it as:
"Execute this function no earlier than x ms"

setTimeout guarantees a *minimum* delay, but can't guarantee exact execution time

You might also like
Find Popular JavaScript/Node.js Libraries Read tip
Restrict SSH Key to Specific Commands Read tip
Easily Test Your .htaccess Rewrite Rules Read tip