ekartgo
Member
I'm converting C code from a PI 4 to a Teensy 4.1. For the PI I use this to get the full time to nanoseconds:
Is there a nanosecond resolution counter I can access that i can combine with others to get a rollover proof time counter?
Although the above is given in unixtime, I don't need any reference to real world time, just a continuous counter with high resolution.
Code:
struct timespec gettime_now;
long long f1_on_time;
clock_gettime(CLOCK_REALTIME, &gettime_now);
f1_on_time = (((long long)gettime_now.tv_sec*1000000000)+(long long)gettime_now.tv_nsec);
Is there a nanosecond resolution counter I can access that i can combine with others to get a rollover proof time counter?
Although the above is given in unixtime, I don't need any reference to real world time, just a continuous counter with high resolution.
Last edited: