We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ddb4e01 commit ec130c0Copy full SHA for ec130c0
packages/webrtc/src/utils.ts
@@ -50,11 +50,10 @@ export function reverseDirection(dir: MediaDirection): MediaDirection {
50
51
export const milliTime = Date.now;
52
53
-const loadTimeNs = process.hrtime.bigint();
54
-const loadTimeMs = BigInt(Date.now()) * 1000n;
+const startupTimestampInMicroseconds = BigInt(Date.now()) * 1000n - process.hrtime.bigint() / 1000n;
55
56
export const microTime = () => {
57
- return (loadTimeMs + (process.hrtime.bigint() - loadTimeNs) / 1000n);
+ return (startupTimestampInMicroseconds + process.hrtime.bigint()/1000n);
58
};
59
60
export const timestampSeconds = () => Date.now() / 1000;
0 commit comments