fix rounding errors in elapsed time in logs
This commit is contained in:
parent
b6c82eb4f5
commit
02ea5c7ee3
@ -1,4 +1,4 @@
|
||||
export const log = (...args) => {
|
||||
const s = performance.now() / 1000;
|
||||
console.log(`[${new Date().toISOString()}] (${Math.floor(s / 60)}m${(s % 60 + 100.05 + '').slice(1, 5)}s)`, ...args);
|
||||
const s = Math.round(performance.now() / 100) / 10;
|
||||
console.log(`[${new Date().toISOString()}] (${Math.floor(s / 60)}m${(s % 60).toFixed(1).padStart(4, '0')}s)`, ...args);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user