convert performance.now to integer before converting to BigInt

This commit is contained in:
Florian Dold 2021-08-12 19:20:32 +02:00
parent abbf899b97
commit df77676977
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B

View File

@ -91,7 +91,7 @@ export const performanceNow: () => bigint = (() => {
// @ts-ignore // @ts-ignore
if (typeof performance !== "undefined") { if (typeof performance !== "undefined") {
// @ts-ignore // @ts-ignore
return () => BigInt(performance.now()) * BigInt(1000 * 1000); return () => BigInt(Math.floor(performance.now() * 1000)) * BigInt(1000);
} }
return () => BigInt(0); return () => BigInt(0);