I would like to determine the wall clock time a JavaScript function is called, with as much accuracy as possible. When my computer makes a call to JavaScript's Date().getTime()
function, does it rely on the internal clock of the local/executing machine at all? If so, what system calls does getTime()
make? And if not, how much error is there on average between the system clock and the time computed by getTime()
?
This StackOverflow question partly addresses my issue but doesn't talk about any possibly latency. I also require much more precision in the computation: Is it safe to compare JavaScript's getTime() across different systems?
As a simplifying example, just assume I'm using a Windows machine running Windows 7.