Skip to content

Commit

Permalink
applied Brad Aagaard's patch to replace clock_gettime() with gettimeo…
Browse files Browse the repository at this point in the history
…fday() on Mac OS.
  • Loading branch information
komatits committed Jul 12, 2013
1 parent 1b56d6d commit 85ee2b9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/meshfem2D/scotch_5.1.12b/src/libscotch/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,14 @@ clockGet (void)
#else /* COMMON_TIMING_OLD */
struct timespec tp;

clock_gettime (CLOCK_REALTIME, &tp); /* Elapsed time */
#if defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0
clock_gettime(CLOCK_REALTIME, &tp);
#else
struct timeval tv;
gettimeofday(&tv, NULL);
tp.tv_sec = tv.tv_sec;
tp.tv_nsec = tv.tv_usec * 1000;
#endif

return ((double) tp.tv_sec + (double) tp.tv_nsec * 1.0e-9L);
#endif /* COMMON_TIMING_OLD */
Expand Down

0 comments on commit 85ee2b9

Please sign in to comment.