effect
effect copied to clipboard
Replace Date.now() Usage with Performance API for More Accurate Timing
What is the problem this feature would solve?
This change improves timing accuracy and reliability by replacing Date.now() with the Performance API.
Date.now() is low-precision and can be affected by system clock changes or frameworks that patch the Date API (e.g., Next.js, ...). The Performance API provides high-resolution, monotonic timestamps that aren’t impacted by such modifications, resulting in more precise measurements across environments.
What is the feature you are proposing to solve the problem?
Replace all uses of Date.now() with the Performance API to provide high-resolution, monotonic, and reliable timestamps unaffected by system clock changes or Date mocks. • MDN: Performance API • MDN: performance.now() • MDN: Date.now()
What alternatives have you considered?
N/A