mvu
asked on
How to set a countdown timer
Hi,
I'd need to know how to set a timer in C/C++, so that at the end of the given time, it executes what i want it to do.
But in the meantime of that happening, i would like the program to execute other tasks.
This would be like a separate process.
thanx for any suggestions and help
I'd need to know how to set a timer in C/C++, so that at the end of the given time, it executes what i want it to do.
But in the meantime of that happening, i would like the program to execute other tasks.
This would be like a separate process.
thanx for any suggestions and help
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanx for the response. How can I get to be in Seconds or hours, instead of milliseconds?
so the way it runs would be something like this:
SetTimer(NULL,1,timeout in msecs,"name of function i like to run at end of timeout");
so the way it runs would be something like this:
SetTimer(NULL,1,timeout in msecs,"name of function i like to run at end of timeout");
ASKER
I did not see your second comment. I am not sure i understand, the function i need to run must be in the TimerProc form....
Can you give an example?
Can you give an example?
ASKER
Thanx! I am all set for what I needed to do, using timerproc and settimer.
Glad I could help :-)
VOID CALLBACK TimerProc( HWND hwnd, // handle of window for timer messages
UINT uMsg, // WM_TIMER message
UINT idEvent, // timer identifier
DWORD dwTime // current system time
);
Try looking up TimerProc in the help file for more information on this function.