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

Calculating durations should use a monotonic clock instead of system_clock #100

Open
jwheeler91 opened this issue Nov 8, 2022 · 0 comments

Comments

@jwheeler91
Copy link

Durations should not use the system_clock as this can change, resulting in "incorrect" durations (e.g. a user changing the system clock back an hour while an application is running in the background could result in a negative duration).

Instead, durations should be calculated using a monotonic clock (e.g. steady_clock)

However: timestamps need to continue to use system_clock as they need a known epoch time (steady_clock won't provide a known epoch - it ends up as time since the clock started)

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