How i can do a Timer in C++?

Started by
4 comments, last by Ilankt 20 years, 10 months ago
Like in VB, the TIMER CONTROL... ?
How appropriate, you fight like a cow!
Advertisement
(all for windows) In managed C++ it''s System.Timers.Timer, in MFC it''s CTimer, in Win32 it''s CreateTimer.
---CyberbrineDreamsSuspected implementation of the Windows idle loop: void idle_loop() { *((char*)rand()) = 0; }
How accurate do you want it to? If youj sut want it down to the second you can use the time() function in ctime that retursn the nubmer of seconds that has passed since 12:00 AM January 1st 1970. If you want it down to the millisecond it depends on your platform.
Also, look into getTickCount or QueryPerformanceCounter.
I guess I was thinking about the wrong timer control *blush*
---CyberbrineDreamsSuspected implementation of the Windows idle loop: void idle_loop() { *((char*)rand()) = 0; }
settimer/killtimer api''s for windows
Well, R2D22U2..

This topic is closed to new replies.

Advertisement