I’m trying to learn c by porting one of my apps. I’m looking for a high resolution timer that works on linux, mac and windows.
Trying to keep with things that are ANSI C99. I’m using mingw and gcc, so any GNU libs should also be fine?
I looked at time.h; but everything I read warns about clock (cpu ticks) isn’t reliable across platforms nor can you get “real time” (instead of cpu time) less than 1 second resolution.
Is there any libs like Boost for C?
Try
gettimeofdayfrom sys/time.h. Although this is not a hi-res timer, it’s more accurate thantimefunction.