X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/e11ca0b5306e3af1665b162e0ae4a364da8899a1..ab8524c54b51ab58c017d27604f94b3e84705e04:/teshsuite/simdag/platforms/Evaluate_parse_time.c diff --git a/teshsuite/simdag/platforms/Evaluate_parse_time.c b/teshsuite/simdag/platforms/Evaluate_parse_time.c index 11ffd3d9ab..3340d38b2b 100644 --- a/teshsuite/simdag/platforms/Evaluate_parse_time.c +++ b/teshsuite/simdag/platforms/Evaluate_parse_time.c @@ -23,18 +23,30 @@ int main(int argc, char **argv) /* initialisation of SD */ SD_init(&argc, argv); +#if _POSIX_TIMERS > 0 if( clock_gettime( CLOCK_REALTIME, &start) == -1 ) { perror( "clock gettime" ); return EXIT_FAILURE; } - +#else + struct timeval tv; + gettimeofday(&tv, NULL); + start.tv_sec = tv.tv_sec; + start.tv_nsec = tv.tv_usec*1000; +#endif /* creation of the environment */ SD_create_environment(argv[1]); +#if _POSIX_TIMERS > 0 if( clock_gettime( CLOCK_REALTIME, &stop) == -1 ) { perror( "clock gettime" ); return EXIT_FAILURE; } +#else + gettimeofday(&tv, NULL); + stop.tv_sec = tv.tv_sec; + stop.tv_nsec = tv.tv_usec*1000; +#endif accum = ( stop.tv_sec - start.tv_sec ) + (double)( stop.tv_nsec - start.tv_nsec )