Skip to content

Commit bb41fab

Browse files
committed
Revert "fix: Adjust for timeOrigin shifts"
This reverts commit 2722542.
1 parent ff40973 commit bb41fab

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

packages/utils/src/misc.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -400,22 +400,11 @@ export const crossPlatformPerformance: CrossPlatformPerformance = (() => {
400400
return getGlobalObject<Window>().performance || performanceFallback;
401401
})();
402402

403-
let FIRST_CLOCK_READ: number | undefined;
404-
405-
/**
406-
* This returns a timestamp of the first time we look at the clock
407-
*/
408-
function getFirstClockRead(): number {
409-
if (!FIRST_CLOCK_READ) {
410-
FIRST_CLOCK_READ = crossPlatformPerformance.timeOrigin;
411-
}
412-
return FIRST_CLOCK_READ;
413-
}
414403
/**
415404
* Returns a timestamp in seconds with milliseconds precision since the UNIX epoch calculated with the monotonic clock.
416405
*/
417406
export function timestampWithMs(): number {
418-
return (getFirstClockRead() + crossPlatformPerformance.now()) / 1000;
407+
return (crossPlatformPerformance.timeOrigin + crossPlatformPerformance.now()) / 1000;
419408
}
420409

421410
// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string

0 commit comments

Comments
 (0)