Skip to content

Replace Date.now() Usage with Performance API for More Accurate Timing #5733

@LisaScheers

Description

@LisaScheers

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.

OpenTelemetry issue

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions