You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Node provides access to high resolution time through process.hrtime(). It can also be used to calculate the time difference between calls.
Example (from NodeJS Docs):
vartime=process.hrtime();// [ 1800216, 25 ]setTimeout(function(){vardiff=process.hrtime(time);// [ 1, 552 ]console.log('benchmark took %d nanoseconds',diff[0]*1e9+diff[1]);// benchmark took 1000000527 nanoseconds},1000);
Do you see a benefit for the higher precision? I see that dt is stored as seconds, so wasn't sure if higher precision would actually make a difference.
The text was updated successfully, but these errors were encountered:
Node provides access to high resolution time through
process.hrtime()
. It can also be used to calculate the time difference between calls.Example (from NodeJS Docs):
Do you see a benefit for the higher precision? I see that
dt
is stored as seconds, so wasn't sure if higher precision would actually make a difference.The text was updated successfully, but these errors were encountered: