Monotonically increasing time in JavaScript?

后端 未结 4 2036
广开言路
广开言路 2020-12-24 03:08

What’s the best way to get monotonically increasing time in JavaScript? I’m hoping for something like Java’s System.nanoTime().

Date() obvi

4条回答
  •  萌比男神i
    2020-12-24 03:23

    Javascript itself does not have any functionality to access the nanoTime. You might load a java-applet to aqcuire that information, like benchmark.js has done. Maybe @mathias can shed some light on what they did there…

提交回复
热议问题