Use a much shorter time to measure current cpu frequency#210
Open
maxnoe wants to merge 2 commits intoworkhorsy:masterfrom
Open
Use a much shorter time to measure current cpu frequency#210maxnoe wants to merge 2 commits intoworkhorsy:masterfrom
maxnoe wants to merge 2 commits intoworkhorsy:masterfrom
Conversation
ca64dbc to
7226cb8
Compare
|
Good idea! For gigahertz frequency there should be still around 10^7 ticks in 0.01 seconds which is plenty. I hope this gets merged soon 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a simple attempt to fix #205.
The full fix (introducing an API that allows only parts of the cpu info to be read out) would still be appreciated, but this is a simple 100x performance improvement.
The obtained cpu frequencies are still very close to the ones measured with a time of 1.0 seconds (at least on my machine) and since the current cpu freq is anyway time dependent, I think this is as precise as anyone can expect.