-
Notifications
You must be signed in to change notification settings - Fork 2
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
Added period checking in RandomInput to reduce CPU load #3
Conversation
c753597
to
e362185
Compare
e362185
to
1fde6f1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of low-level C routines, consider using std::chrono::steady_clock
. I think you won't need the TimeUtils.*
files then.
linux/libio/TimeUtils.h
Outdated
#include <stdint.h> // `UINT64_MAX` | ||
#include <unistd.h> | ||
#include <stdio.h> // `printf()` | ||
#include <time.h> // `timespec_get()` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't pollute headers with not required includes. Move them to the .cpp.
I knew you would ask that, but first the whole app is using a lot of C code everywhere and second the problem is not on measuring the time, but on waiting. I do not have time to modernize this app now (and also not the skills as you know) but tried std::chrono as I showed So I would rather keep this old-style code to not have mixed old-style modern c++ |
As you already used |
The question is not of being capable or not. Finding examples for a tiny modern c++ solution is always possible but changing the whole app to something suitable is another task that I do not feel capable of doing (and I repeat I do not have time to do it) Mixing is something I did not know you were ready to accept is also one reason I did not provide a PR with this I stay on the impression that this so if you do not want this PR as is, close it please. I will keep the changes on my fork only. I do not have time to modernize the code. |
Superseeded by #4 |
Solves issue #2 according to suggestions