Is there any way to get current time in nanoseconds using JavaScript?

前端 未结 7 907
名媛妹妹
名媛妹妹 2020-11-30 12:11

So, I know I can get current time in milliseconds using JavaScript. But, is it possible to get the current time in nanoseconds instead?

相关标签:
7条回答
  • 2020-11-30 12:57

    No. There is not a chance you will get nanosecond accuracy at the JavaScript layer.

    If you're trying to benchmark some very quick operation, put it in a loop that runs it a few thousand times.

    0 讨论(0)
提交回复
热议问题