Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to implement a timer in C on windows

Tags:

c

timer

winapi

How do I create a timer in C and after the time expires ,I should be able to call a callback function . The platform is windows.

Can someone guide me

Regards, Mithun

like image 227
Vidya Avatar asked Sep 17 '09 11:09

Vidya


1 Answers

Take a look at SetTimer function.

UINT_PTR timerid = SetTimer(NULL, 0, milliseconds, &callback);
like image 50
avakar Avatar answered Oct 01 '22 22:10

avakar