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

The clock_gettime execution time is not 500ns #84

Open
ujos opened this issue Jan 1, 2025 · 0 comments
Open

The clock_gettime execution time is not 500ns #84

ujos opened this issue Jan 1, 2025 · 0 comments

Comments

@ujos
Copy link

ujos commented Jan 1, 2025

In the book page 34 there is a sentence:

Making a clock_gettime system call can be much slower than executing RDTSC
The latter takes about 5ns while the former takes about 500ns.

high_resolution_clock is not that expensive:

  • On my laptop with 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz CPU and Ubuntu 22.04 it takes 12ns.
  • On the AMD EPYC 9274F 24-Core CPU RH9 it takes 20ns
  • On the Intel(R) Xeon(R) Gold 5318Y CPU RH9 it takes 23ns
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

1 participant