Add a ms_to_timespec helper function, and create a cgsleep_ms function that uses absolute timers with clock_nanosleep to avoid overruns.
Make the nmsleep and nusleep functions use the new cgsleep functions internally till functions are migrated to the new cgsleep API.
Provide reentrant versions of cgsleep functions to allow start time to be set separately from the beginning of the actual sleep, allowing scheduling delays to be counted in the sleep.
Use the reentrant cgsleep function to time sleeps on reading from avalon.
Set high resolution timing on windows within the cgsleep functions.
Use the reentrant cgsleep functions within the avalon_send_tasks function.
Use the cgsleep reentrant function in avalon_send_task.
Make the cgsleep functions build on windows.
Make cgsleep_us_r take an int64_t for us.
Fix missed endtimeperiod in overrun timer on windows.