The console.time
function seems to decide which units to display in the log message based on the the length of time that has elapsed. For example:
console.time('timer-ms');
setTimeout(() => console.timeEnd('timer-ms'), 20);
// timer-ms: 20.044ms
console.time('timer-s');
setTimeout(() => console.timeEnd('timer-s'), 2000);
// timer-s: 2.002s
Is it possible to change this behaviour so that the log message always displays the same units, regardless of the time that has elapsed? In the above example, I would want the second output to be timer-s: 2002ms