Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider exposing renderTime to Event Timing #131

Open
mmocny opened this issue Feb 2, 2023 · 0 comments
Open

Consider exposing renderTime to Event Timing #131

mmocny opened this issue Feb 2, 2023 · 0 comments
Assignees

Comments

@mmocny
Copy link
Contributor

mmocny commented Feb 2, 2023

Element timing already exposes a renderTime property, which matches the same concept that Event Timing uses for measuring duration.

However, Event Timing does not actually expose the renderTime. Instead, Event Timing using startTime == event.timeStamp, and exposes a duration == (renderTime - startTime), rounded to the nearest 8ms.

Common advice in JS is to: let renderTime = startTime + duration to work around this.

Computing renderTime is useful in order to:

  • Create User Timings to showcase events from start to end
  • Group events by animation frame

Unfortunately, the fact that we round duration to 8ms makes this difficult. Because each event may have a unique timeStamp, renderTime can end up with awkward offsets.

See Screenshot, which showcases User Timings of Event Timing (above) and real trace events with accurate times (below):
Screenshot 2023-02-01 at 9 50 44 PM

Notice the staggered end time, and also that the last event appears to end earlier.. because it was rounded down instead of rounded up like the others.

Consider just exposing renderTime to Event Timing. It could still be rounded to 8ms, but it would be the same value for all events which appear in the same paint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant