timers in c++

Discussion in 'C++' started by carmen, Jun 30, 2005.

  1. carmen

    carmen Guest

    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
    carmen, Jun 30, 2005
    #1
    1. Advertising

  2. Einar Forselv, Jun 30, 2005
    #2
    1. Advertising

  3. try alarm(), ftime(), and time()
    blueblueblue2005, Jun 30, 2005
    #3
  4. #include <unistd.h>
    unsigned int alarm(unsigned int time_value);

    this is actually a c function, but can be called in c++ program
    blueblueblue2005, Jun 30, 2005
    #4
  5. carmen

    carmen Guest

    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++?
    carmen, Jun 30, 2005
    #5
  6. carmen

    carmen Guest

    Hi,

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

    Thanks,
    Carmen
    carmen, Jun 30, 2005
    #6
  7. carmen

    Marchello Guest

    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.
    Marchello, Jun 30, 2005
    #7
  8. carmen

    Zara Guest

    Zara, Jun 30, 2005
    #8
  9. carmen

    REH Guest

    "carmen" <> wrote in message
    news:...
    > Hi,
    >
    > Thanks :again :). But, I am developing on windows. This is a unix
    > header right?
    >
    > Thanks,
    > Carmen
    >

    google for WM_TIMER event.
    REH, Jun 30, 2005
    #9
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stephen Inkpen

    Timers in application web programming

    Stephen Inkpen, Jul 16, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    339
    Ken Cox [Microsoft MVP]
    Jul 16, 2003
  2. Kelsang Wangchuk

    System.Timers.Timer vs. System.Threading.Timer

    Kelsang Wangchuk, Jul 31, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    713
    Kelsang Wangchuk
    Jul 31, 2003
  3. Girish Pal Singh

    timers

    Girish Pal Singh, Aug 11, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    562
    Kevin Spencer
    Aug 11, 2003
  4. Girish Pal Singh

    Web Timers

    Girish Pal Singh, Aug 13, 2003, in forum: ASP .Net
    Replies:
    4
    Views:
    443
    George Ter-Saakov
    Aug 13, 2003
  5. Steve C. Orr [MVP, MCSD]

    Re: timers

    Steve C. Orr [MVP, MCSD], Dec 8, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    392
    Steve C. Orr [MVP, MCSD]
    Dec 8, 2003
Loading...

Share This Page