javascript - May the actual delay of setTimeout be shorter? - Stack Overflow

According to documentation the actual delay of setTimeout may be longer than was asked. Could you pleas

According to documentation the actual delay of setTimeout may be longer than was asked. Could you please point me on documentation or question with answer which explains may the actual delay of setTimeout be shorter than was asked?

Thing is I encountered an issue which happened really seldom and could be explained by such phenomenon. Platforms: Chrome Version 67, NodeJS Version 9.8.0. Also, I am really curious is this statement true for Firefox and other browsers?

According to documentation the actual delay of setTimeout may be longer than was asked. Could you please point me on documentation or question with answer which explains may the actual delay of setTimeout be shorter than was asked?

Thing is I encountered an issue which happened really seldom and could be explained by such phenomenon. Platforms: Chrome Version 67, NodeJS Version 9.8.0. Also, I am really curious is this statement true for Firefox and other browsers?

Share Improve this question asked Jun 18, 2018 at 14:33 KosKos 1,77817 silver badges27 bronze badges
Add a ment  | 

4 Answers 4

Reset to default 6

You can test a timeout or interval accuracy by taking a delta of two microtimes. In my tests, the timers are plus or minus a few milliseconds. Run the program below to see the results in your own environment.

In a perfect world, the output would always show 1000. The variance in the output means our world is imperfect

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745601472a4635425.html

相关推荐

  • javascript - May the actual delay of setTimeout be shorter? - Stack Overflow

    According to documentation the actual delay of setTimeout may be longer than was asked. Could you pleas

    12小时前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信