Thread: Protable Approach To get System Time

  1. #1
    Registered User
    Join Date
    Oct 2008
    Posts
    10

    Protable Approach To get System Time

    Hello to all, does anyone know any approaches that get system time that works on platform independent ?

    Thanks.

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    >> Hello to all, does anyone know any approaches that get system time that works on platform independent ?

    Sure, any of the standard C library functions.
    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;
    }

  3. #3
    Registered User
    Join Date
    Oct 2008
    Posts
    10
    You mean time(0);

  4. #4
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    >> You mean time(0);

    I mean any of the function related to the ctime header. And just being pedantic here but time(0) is not a function but it's *invocation*.
    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. Read and set\change system time
    By Hexxx in forum C++ Programming
    Replies: 9
    Last Post: 01-02-2006, 07:11 AM
  2. Replies: 4
    Last Post: 06-13-2005, 09:03 AM
  3. time of system
    By arian in forum C++ Programming
    Replies: 3
    Last Post: 12-10-2003, 12:51 PM
  4. how to ouput system date and time?
    By toaster in forum C++ Programming
    Replies: 1
    Last Post: 04-21-2002, 10:58 PM
  5. Passing system time to a function
    By Unregistered in forum C++ Programming
    Replies: 7
    Last Post: 02-14-2002, 01:56 PM