0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-12-01 17:30:59 +01:00

chore: Remove the need for node:process (#8795)

performance.now() exist in all envs we support now
This commit is contained in:
Jimmy Wärting 2023-06-22 08:03:15 -05:00 committed by GitHub
parent 980b325989
commit 7cbd36d6b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,10 +1,4 @@
const now =
typeof process !== 'undefined' && process.hrtime
? () => {
const t = process.hrtime();
return t[0] * 1e3 + t[1] / 1e6;
}
: () => self.performance.now();
const now = () => performance.now();
/** @param {any} timings */
function collapse_timings(timings) {