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)
process.hrtime() not give current ts.
This should work.
const loadNs = process.hrtime(), loadMs = new Date().getTime(), diffNs = process.hrtime(loadNs), microSeconds = (loadMs * 1e6) + (diffNs[0] * 1e9) + diffNs[1] console.log(microSeconds / 1e3)