Is setTimeout with no delay the same as executing the function instantly?

前端 未结 3 2231
夕颜
夕颜 2020-11-27 18:31

I am looking at some existing code in a web application. I saw this:

window.setTimeout(function () { ... })

Is this the same as just executing t

3条回答
  •  醉梦人生
    2020-11-27 18:48

    There is a minimum delay that setTimeout uses (4ms as per HTML5, Firefox 3.6 uses 10ms). There is a discussion about it on the Mozilla Developer Center documentation page.

提交回复
热议问题