How to get microsecond timings in JavaScript since Spectre and Meltdown
问题 The situation When writing high-performance JavaScript code, the standard profiling tools offered by Chrome et al are not always sufficient. They only seem to offer function-level granularity and it can be quite time-consuming to drill down and find the information I need. In .NET the StopWatch class gives me exactly what I need: sub-microsecond resolution timing of arbitrary pieces of code. For JavaScript performance.now() used to be a pretty good way to measure performance, but in response