prefer-monotonic-for-elapsed-time
Measure elapsed time with a monotonic clock rather than wall-clock timestamps.
Why
Clock corrections can make Date.now differences jump or turn negative even when a duration is the only intended observation.
Fix
Use performance.now consistently at both ends of a duration. Keep wall-clock timestamps when they are stored, displayed or otherwise part of the contract.
Examples
const start = Date.now();consume(Date.now() - start);const start = performance.now();consume(performance.now() - start);