How to get a microtime in Node.js?

后端 未结 13 1175
情深已故
情深已故 2020-12-04 13:41

How can I get the most accurate time stamp in Node.js?

ps My version of Node.js is 0.8.X and the node-microtime extension doesn\'t work for me (crash on install)

相关标签:
13条回答
  • 2020-12-04 14:40

    there are npm packages that bind to the system gettimeofday() function, which returns a microsecond precision timestamp on Linux. Search for npm gettimeofday. Calling C is faster than process.hrtime()

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