c - Timers and Sleep on windows -
i trying port linux code uses nanosleep()
, get_clocktime()
windows. far have read there isn't many performance timers on windows , there no real sleep functions other sleep()
. found queryperformancecounter
, queryperformancefrequency
on windows, how adapt utilize fast sleep function. code in trying port located @ stackoverflow post: http://stackoverflow.com/a/13559213/1161270
overall i'm trying port linux code windows uses nanosleep()
, get_clocktime()
, struct timespec
, there seems no real equivalent. open other ideas on how add together throttle delays. i've read pdhgetformattedcounterarray()
functions , have working code monitor output bandwidth of computer in bytes, unsure on how utilize info create delay throttle info sending specific kb/s speed, , much rather utilize other method provided in linked post.
thank time.
bear in mind actual precision on os's types of sleeps in milliseconds (or multiple thereof). may appear can sleep shorter periods, in reality, either os doesn't set process sleep, or sleep period "ticks". true both linux (depending on kernel configuration) , windows.
microsoft explains timeouts here (and sleep timeout waiting nil happen): http://msdn.microsoft.com/en-gb/library/windows/desktop/ms687069%28v=vs.85%29.aspx#waitfunctionsandtime-outintervals
c windows bandwidth throttle
No comments:
Post a Comment