Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are timers supported by the Windows native API?

Tags:

c

windows

timer

Does the Windows native API support timers?

I am aware that POSIX implementations on Windows support timers, but I am interested in Windows SDK APIs.

like image 442
Jay Avatar asked Dec 01 '22 05:12

Jay


2 Answers

Yes there are timers in Win32 API. More details you can check here : Timers

In particular you need to check

  • SetTimer
  • KillTimer
  • TimerProc
  • WM_TIMER
like image 166
Incognito Avatar answered Dec 04 '22 06:12

Incognito


It sure does: http://windows-programming.suite101.com/article.cfm/using_the_win32_timer_api

The SetTimer API mentioned in that article depends on the WM_TIMER message, which means that you have to have a message loop, which means that you (probably) have to have a window. So it's very useful for GUI programming, less so for command-line tools.

like image 28
JSBձոգչ Avatar answered Dec 04 '22 06:12

JSBձոգչ