On Tue, 08 Dec 2015 15:35:18 +0000, Taylor Hillegeist wrote: > So, I mostly do programming that is of run to completion verity. > But I have a dream of calling functions periodically. So my question is: > > What is the best (most time accurate) way to call a function every n > time units?
Busy-wait and access the CPU's high precision clock. If you have an extended wait and don't want to busy-wait the whole time, sleep up to, say, 5ms before the time you want to call the function, then busy-wait.