kmudrick / superagent-timer

Superagent Plugin to time request times
MIT License
0 stars 0 forks source link

High resolution timing #2

Open tbranyen opened 7 years ago

tbranyen commented 7 years ago

In Node you can achieve precise high-resolution time signatures useful for performance using process.hrtime: https://nodejs.org/dist/latest-v6.x/docs/api/process.html#process_process_hrtime_time

In browsers you can use: http://caniuse.com/#search=performance.now which also achieves a high resolution timestamp.

The fallback could work using the existing implementation.

Any thoughts on this @kmudrick?

kmudrick commented 7 years ago

Yes! I will add that - thanks @tbranyen

kmudrick commented 7 years ago

I wonder how testable either of those are. Hmm.