Is there a way to get the time a piece of JavaScript actually runs on the CPU, like with the clock()
and getrusage()
functions in C? Using the normal Date()
way only gives the wall time, and for performance measurements the CPU time would be much more useful.
Note that I'm not looking for profiling tools, I want to reduce system noise for automated testing and not optimize specific functions.