• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

C Code Timer or Clock

MaDHaVoK

Senior member
I am trying to create a timer.. that would start at 00:00:00:0 (HH:MM:SS:Tenth S) and go to 11:59:59.9 then reset to zero. My problem is I would like this to be accurate to the tenth of second... Any links where I could get help on this?

Thanks!
-Patrick
 
You could use a normal int or long and just increment it every 10th of a second (use nanosleep or usleep to keep time), but unless you're using a real-time scheduler you're not guaranteed it'll be perfect, you should use gettimeofday calls to verify how long you slept.
 
It is very likely that any solution to your problem is going to be very Operating-System specific.
 
Back
Top