Timestamps
suggest changeSyntax
- millisecondsAndMicrosecondsSincePageLoad = performance.now();
- millisecondsSinceYear1970 = Date.now();
- millisecondsSinceYear1970 = (new Date()).getTime();
Remarks
performance.now() measures milliseconds since the document’s time origin, not since 1970. Browsers may coarsen it, often to 0.1 ms or 1 ms, so it is not always sub-millisecond. Node provides the same method.
Date.now() and (new Date()).getTime() follow the system clock, so a clock adjustment can move them backward or forward.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents