-#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 )
- / (double)BILLION;
-
- printf( "%lf\n", accum );
+ /* Display the result and exit after cleanup */
+ printf( "%lf\n", xbt_os_timer_elapsed(timer) );