X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=include%2Ftimer.h;h=78b19e907358e73b768aebb05093ac4ac0b504fe;hb=a9c9c7d1a1068e92145c923fab2801149e0e6899;hp=705627f703dd561a8b63555343843a686ddf3526;hpb=3fba6928127cd65870bdcd96c8114ad5894247ae;p=ctsim.git diff --git a/include/timer.h b/include/timer.h index 705627f..78b19e9 100644 --- a/include/timer.h +++ b/include/timer.h @@ -2,7 +2,9 @@ #include "config.h" #endif +#ifdef HAVE_SYS_TIME_H #include +#endif class Timer { @@ -43,11 +45,15 @@ class Timer double ttime(void) const { +#ifdef HAVE_GETTIMEOFDAY struct timeval now; if (gettimeofday (&now, NULL)) return 0; return (now.tv_sec + static_cast(now.tv_usec) / 1000000.); +#else + return 0; +#endif } };