Comment

Comment by madog

Just use gettimeofday/clock_gettime via vDSO.

  struct timespec ts;
  clock_gettime(CLOCK_MONOTONIC, &ts);
On arm64 it directly uses the cntvct_el0 register under the hood but with a standard/easy to use API instead of messing about with inline assembly. Also avoids a context switch because it's vDSO.
parent madog 1 year ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton