Changeset 376 for trunk/src/core/time.cc


Ignore:
Timestamp:
05/28/15 10:21:10 (10 years ago)
Author:
epyon
Message:
  • stl/assert.hh, stl/capi.hh, size_t independent
  • GCC 4.8 compatibility
  • using template usage
  • various minor changes
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/core/time.cc

    r319 r376  
    77#include "nv/core/logging.hh"
    88
     9#include <ctime>
     10
    911#if NV_COMPILER == NV_MSVC
    1012#define WIN32_LEAN_AND_MEAN
     
    1315#pragma intrinsic(__rdtsc)
    1416#else
    15 #include <unistd.h>
     17#if NV_COMPILER == NV_GNUC && NV_PLATFORM == NV_WINDOWS
     18// mingw doesn't have usleep nor nanosleep...
     19#include <windows.h>
     20#endif
     21// #include <unistd.h>
     22// #include <time.h>
     23// #include <sys/time.h>
     24// #include <sys/types.h>
     25#include <stdio.h>
     26#include <time.h>
    1627#include <sys/time.h>
    1728#endif
    1829
    19 #include <ctime>
     30
    2031
    2132struct timer_impl
     
    5869        Sleep( ms );
    5970#else
    60         usleep( ms * 1000 );
     71#if NV_COMPILER == NV_GNUC && NV_PLATFORM == NV_WINDOWS
     72        Sleep( ms );
     73#else
     74        struct timespec ts;
     75        ts.tv_sec = 0;
     76        ts.tv_nsec = ms * 1000000;
     77        nanosleep(&ts, NULL);
     78//      usleep( ms * 1000 );
     79#endif
    6180#endif
    6281}
Note: See TracChangeset for help on using the changeset viewer.