Skip to content

Revert "<chrono>: Cache QueryPerformanceFrequency() and divide just o… - #972

Merged
Stephan T. Lavavej (StephanTLavavej) merged 3 commits into
microsoft:masterfrom
AlexGuteniev:undo_chrono_changes
Jul 3, 2020
Merged

Stephan T. Lavavej (StephanTLavavej) merged 3 commits into
microsoft:masterfrom
AlexGuteniev:undo_chrono_changes

Conversation

@AlexGuteniev

@AlexGuteniev Alex Guteniev (AlexGuteniev) commented Jul 2, 2020

Copy link
Copy Markdown
Contributor

…nce (#653)"

This reverts commit ad1a26a.

Fixes #971.

@BillyONeal

Copy link
Copy Markdown
Member

Why do you want to revert this?

@BillyONeal

Copy link
Copy Markdown
Member

Oh I see the linked issue

@CaseyCarter Casey Carter (CaseyCarter) linked an issue Jul 2, 2020 that may be closed by this pull request
@CaseyCarter Casey Carter (CaseyCarter) added the bug Something isn't working label Jul 2, 2020

@BillyONeal Billy O'Neal (BillyONeal) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:'(

@cbezault

Copy link
Copy Markdown
Contributor

Why not just fix the calculation?

@AlexGuteniev

Copy link
Copy Markdown
Contributor Author

The proposed fix in #971 introduces precision loss if den does not divide by frequency (observed, although rarely).

There are still ways to optimize. _div128 is one of options. Another is to special case 10'000'000 frequency, as it is common. But I think the first thing to do is to fix the bug. And then probably don't touch this anymore.

Comment thread stl/inc/chrono Outdated
@StephanTLavavej
Stephan T. Lavavej (StephanTLavavej) merged commit 5be7d49 into microsoft:master Jul 3, 2020
@StephanTLavavej

Copy link
Copy Markdown
Member

Thanks again for fixing this so quickly! 😺

@AlexGuteniev
Alex Guteniev (AlexGuteniev) deleted the undo_chrono_changes branch July 3, 2020 04:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working high priority Important!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

<chrono>: std::chrono::steady_clock::now() overflow

6 participants