Thread: C++ Timer?

  1. #1
    Registered User
    Join Date
    Nov 2004
    Posts
    10

    C++ Timer?

    Hey guys,

    Been doing a lot of java/.net stuff for the past couple years, but trying to get back into c++ as a side project. have always been interested in simple real time simulation apps. ive done a couple in c# for example, which has a cool timer object and associated tick functions. ive done some searching and so far understand that there is no equivalent c++ option? what features would i want to research to dabble in some real time simulation apps?

    thanks a bunch

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    you can create timers with win32 apps, otherwise you could design a timer object that uses a thread and a callback function to achieve that functionality.
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. SIGALRM and timer
    By nkhambal in forum C Programming
    Replies: 1
    Last Post: 06-30-2008, 12:23 AM
  2. tic tac toe crashes :(
    By stien in forum Game Programming
    Replies: 4
    Last Post: 05-13-2007, 06:25 PM
  3. Need help with a count down timer
    By GUIPenguin in forum C# Programming
    Replies: 0
    Last Post: 07-07-2006, 04:18 PM
  4. Timer again.
    By geek@02 in forum Windows Programming
    Replies: 1
    Last Post: 05-04-2005, 10:19 PM