开发者

Porting VC++ SetWaitableTimer to gcc

开发者 https://www.devze.com 2023-02-03 03:05 出处:网络
I\'ve legacy code that uses SetWaitableTimer to perform some task at 10 sec after midnight. SetWaitableTimer has the following feature, which is used in the code:

I've legacy code that uses SetWaitableTimer to perform some task at 10 sec after midnight.

SetWaitableTimer has the following feature, which is used in the code:

If the system tim开发者_如何学JAVAe is adjusted, the due time of any outstanding absolute timers is adjusted.

I'm porting code to gcc/Linux. How I can simulate the above behaviour?


This is a pretty good overview of linux timer functions. You want the timer_create() / timer_delete() family with CLOCK_REALTIME, then timer_settime() with TIMER_ABSTIME. According to this FAQ it should be adjusted if there is a change to the system clock though I have never tested it.

0

精彩评论

暂无评论...
验证码 换一张
取 消