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

CPU times overflows ? #4

Open
gmircea opened this issue Aug 23, 2017 · 1 comment
Open

CPU times overflows ? #4

gmircea opened this issue Aug 23, 2017 · 1 comment

Comments

@gmircea
Copy link

gmircea commented Aug 23, 2017

What happens if the vars that stores the Core.user, Core.nice, Core.system etc overflow ? The values are larger than int64 ? I guess you could get some large values on a long running system.
When doing the diff between new_CPU and old_CPU you'll get funny results...
Or even when computing CPU total in Core::cpuTotal().
Or am I missing something ?

@lightful
Copy link
Owner

The counters represent 1/100ths of a second, so the computer should run for 3000 million years to overflow them. Even by then, the relative deltas could still be Ok due to how integers work, but that doesn't deserves a test...

Bits are not so small, an almost "perfect" clock would only need 256 bits :-)

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

2 participants