2 ms·
> If an interval time needs to be measured, then rdtsc, or a library wrapped around it, is the best solution, whereas getting the system time for use in log fil
by zimbatm 11y ago
> If an interval time needs to be measured, then rdtsc, or a library wrapped around it, is the best solution, whereas getting the system time for use in log files probably ought to be carried out using clock_gettime()with a FAST option; or, if clock_gettime() is not available, then gettimeofday().
If I remember correctly RDTSC suffers from other issues like being affect by CPU throttling and also might be different if your process is re-scheduled on another core.