Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7909 in orxonox.OLD for branches/gui/src/lib/util


Ignore:
Timestamp:
May 27, 2006, 4:23:59 PM (19 years ago)
Author:
bensch
Message:

gui: also works on windows

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/gui/src/lib/util/timer.cc

    r7900 r7909  
    1212#include <sys/time.h>
    1313
     14#ifdef __WIN32__
     15#include <windows.h>
     16int gettimeofday
     17      (struct timeval* tp, void* tzp) {
     18    DWORD t;
     19    t = timeGetTime();
     20    tp->tv_sec = t / 1000;
     21    tp->tv_usec = 1000 * (t % 1000 );
     22    /* 0 indicates success. */
     23    return 0;
     24}
     25#endif
     26
    1427/**
    1528 * @returns the current time in Second exact to the micro-second
     
    1831
    1932#if HAVE_CLOCK_GETTIME
     33
    2034   // use the POSIX realtime clock to get the current time
    2135    struct timespec tp;
Note: See TracChangeset for help on using the changeset viewer.