diff options
Diffstat (limited to 'mysys/my_getsystime.c')
-rw-r--r-- | mysys/my_getsystime.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mysys/my_getsystime.c b/mysys/my_getsystime.c index ece0c5fdd87..f1caea6d21a 100644 --- a/mysys/my_getsystime.c +++ b/mysys/my_getsystime.c @@ -118,6 +118,7 @@ void my_time_init() ulonglong my_getcputime() { +#ifdef CLOCK_THREAD_CPUTIME_ID #ifdef HAVE_CLOCK_GETTIME struct timespec tp; if (clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp)) @@ -128,7 +129,8 @@ ulonglong my_getcputime() if (syscall(__NR_clock_gettime, CLOCK_THREAD_CPUTIME_ID, &tp)) return 0; return (ulonglong)tp.tv_sec*10000000+(ulonglong)tp.tv_nsec/100; -#else - return 0; #endif /* HAVE_CLOCK_GETTIME */ +#else /* HAVE_THREAD_CPUTIME_ID */ + return 0; +#endif } |