As Jeffrey's answer said, window.performance.now()
gives microsecond accuracy on most browsers. However, the actual value it returns is in milliseconds; it's just that its decimal portion enables microseconds to be calculated. I.e.: window.performance.now() * 1000
.