Implementing setTimeout() and setInterval() in pure JavaScript

前端 未结 2 1219
灰色年华
灰色年华 2021-01-14 18:02

I have some JavaScript benchmark code that is supported to be running on browser. But I would like to run it on console mode of JavaScript engine such as \'d8\' in V8 for te

2条回答
  •  粉色の甜心
    2021-01-14 18:27

    You can't to that with just V8 + some JS, you have to embbed the JS engine in some kind of runtime that supports timers. For V8 there's zombie.js for instance.

提交回复
热议问题