timers in c++

C

carmen

Hello,

I have been searching msdn, but to no avail. Can anyone tell me if
there are any timer functions available for c++? (unmanaged). I want to
be able to set a timer, while accomplishing other tasks. If the timer
expires, the application exits.

Thanks,
Carmen
 
B

blueblueblue2005

#include <unistd.h>
unsigned int alarm(unsigned int time_value);

this is actually a c function, but can be called in c++ program
 
C

carmen

Hi,

Thanks :). I checked it out. But the problem is, I need to set the
timer and continue processing! When the timer expires, an event handler
should take over. Is this possible in c++?
 
C

carmen

Hi,

Thanks :again :). But, I am developing on windows. This is a unix
header right?

Thanks,
Carmen
 
M

Marchello

GetTickCount(); in milisec
QueryPerformanceCounter(); in microsec


__int64 cnt()
{
__int64 res;

__asm
{
rdtsc

mov dword ptr [res], eax
mov dword ptr [res + 4], edx
}

return res;
} // count of processor ticks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top