Firefox setTimeout(func, ms) sending default parameters to callback

前端 未结 2 1372
别那么骄傲
别那么骄傲 2021-01-21 23:06

I am unable to find out more about this default parameter that I ran across and was hoping that someone could point out an explanation.

In Firefox (3.6 in this case) if

2条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-21 23:25

    From MDC

    Gecko passes an extra parameter to the callback routine, indicating the "lateness" of the timeout in milliseconds.

    Because the "actual" delay maybe longer than the delay specified in the setTimeoutcall, the "lateness" will be zero if the function was called exactly after the delay specified, non-zero otherwise.

提交回复
热议问题