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

Use a much shorter time to measure current cpu frequency #210

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

maxnoe
Copy link

@maxnoe maxnoe commented Jan 4, 2024

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.

@maxnoe maxnoe force-pushed the shorter_cpu_freq_measurement branch from ca64dbc to 7226cb8 Compare January 4, 2024 13:11
@anttimc
Copy link

anttimc commented Feb 27, 2024

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 👍

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

Successfully merging this pull request may close these issues.

Performance issue on Ubuntu
2 participants