What is minimum millisecond value of setTimeout?

前端 未结 4 1503
无人共我
无人共我 2020-11-22 13:28

I would like to put

var minValue = 0;
if ( typeof callback == \'function\' ) {
    setTimeout( callback, minValue );
}

this code when I imp

4条回答
  •  野性不改
    2020-11-22 14:06

    I think that 10 will be the most reliable minimum in all browser, since I've seen a lot of codes using it.

    However, 4ms is the minimum for HTML5

    In fact, 4ms is specified by the HTML5 spec and is consistent across browsers released in 2010 and onward. Prior to (Firefox 5.0 / Thunderbird 5.0 / SeaMonkey 2.2) , the minimum timeout value for nested timeouts was 10 ms.

提交回复
热议问题