X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=include%2Ftimer.h;h=78b19e907358e73b768aebb05093ac4ac0b504fe;hp=705627f703dd561a8b63555343843a686ddf3526;hb=01ee1e0085970643368d65c38b09008927e24cd5;hpb=3fba6928127cd65870bdcd96c8114ad5894247ae 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 } };