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

fix: use monotonic clock for timing code #19138

Merged
merged 2 commits into from
Dec 6, 2022

Conversation

ankush
Copy link
Member

@ankush ankush commented Dec 6, 2022

time.time() depends on system clock which can drift away and get corrected
over time. If you're unlucky it will get corrected in your timing code
and give absurd results.

https://docs.python.org/3/library/time.html#time.monotonic

`time.time()` depends on system clock which can drift away and get corrected
over time. If you're unlucky it will get corrected in your timing code
and give absurd results.
@ankush ankush requested a review from a team as a code owner December 6, 2022 09:31
@ankush ankush requested review from phot0n and removed request for a team December 6, 2022 09:31
@ankush ankush changed the title fix: use monotonic time for timing code fix: use monotonic clock for timing code Dec 6, 2022
@codecov
Copy link

codecov bot commented Dec 6, 2022

Codecov Report

Merging #19138 (9bdfd07) into develop (9e91f20) will decrease coverage by 0.01%.
The diff coverage is 60.00%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #19138      +/-   ##
===========================================
- Coverage    63.72%   63.70%   -0.02%     
===========================================
  Files          750      750              
  Lines        67710    67710              
  Branches      6042     6042              
===========================================
- Hits         43145    43137       -8     
- Misses       21135    21143       +8     
  Partials      3430     3430              
Flag Coverage Δ
server-postgres 67.59% <60.00%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

can refresh and give wrong output

[skip ci]
@ankush ankush merged commit bbcc365 into frappe:develop Dec 6, 2022
@ankush ankush deleted the monotonic_measures branch December 6, 2022 10:12
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant