-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
the time::WallClock::fastNowInSec()
is getting more and more ahead
#5833
Comments
not sure if this is by-designed |
|
Years ago, I had noticed this buggy problem but didn't dive into it, and never have reproduced it ever since. Yeah you are right. The so called fast version of WallClock is kind of not predictable because of how it works when converting the CPU ticks to realtime duration. It's subject to many aspects including the rdtsc instruction itself, accuracy of the system timer and even system load during caliberation. So we discourage to use it in some critical situations. If you are interesting in this issue, you could try out to utilize this kernel module to make the conversion mentioned above more accurate and eliminate the caliberation process. |
thx for the prompt reply. |
Describe the bug (required)
the deviation of the time::WallClock::fastNowInSec() is unpredictable.
I've noticed that on my different machines, the timepoint generated by fastNowInSec is unpredictable.
some of the results show that the fastNowInSec is always consistent with the slowNowInSec, the others show that the differences between the two continue to widen.
I'm not sure if this will lead to a buggy behavior on the scenario that requires two timepoints to cal the duration. (like TTL or something)
Your Environments (required)
uname -a
g++ --version
orclang++ --version
lscpu
a3ffc7d8
)How To Reproduce(required)
Steps to reproduce the behavior:
running the above code for a period of time, got the following result.
Expected behavior
the fast one can be not so precise but the differences should be limited to a predictable range.
The text was updated successfully, but these errors were encountered: