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
Secure File Transfer From/To Remote Server Read tip
Assign a Random Port to Node.js Server Read tip
Relinquish Process Privileges in Node.js Read tip