tsc time issue
Closed this issue · 6 comments
The last image doesn't show how the "actual time" is computed. However, there's no way I could figure out what's going on by looking at partial images of your source code. TSC timetsamping is a difficult topic, subject to a large number of issues (e.g: see comment in the code that you copied from google benchmark, or think about clock skew, that requires sending TscSync entries peridocally, etc).
The last image doesn't show how the "actual time" is computed. However, there's no way I could figure out what's going on by looking at partial images of your source code. TSC timetsamping is a difficult topic, subject to a large number of issues (e.g: see comment in the code that you copied from google benchmark, or think about clock skew, that requires sending TscSync entries peridocally, etc).
Attach my local time function GetCurTimeStr()
My program run at CentOS 8.
Clock skew is described here: https://en.wikipedia.org/wiki/Clock_skew
If you experience that the tsc timestamp increasingly drifts away from the NTP synchronized clock, you can try adding a ClockSync entry periodically (e.g: once in a minute), or improve the way the tsc frequency is calculated.