diff options
| author | Bernard Xiong <[email protected]> | 2017-12-23 23:58:18 +0800 |
|---|---|---|
| committer | Bernard Xiong <[email protected]> | 2017-12-24 00:06:29 +0800 |
| commit | e1da54e513f973c6073eef5f076e589b679b0736 (patch) | |
| tree | 80b10d0464fb829115d52e742a69685f380ae619 | |
| parent | f746c6e55607e9334cd82adc4b5148f0f3e07b89 (diff) | |
[pthreads] Add CLOCK_CPUTIME_ID/CLOCK_MONOTONIC clock_id
| -rw-r--r-- | components/libc/pthreads/pthread.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/components/libc/pthreads/pthread.h b/components/libc/pthreads/pthread.h index 35fa817c0f..81af885981 100644 --- a/components/libc/pthreads/pthread.h +++ b/components/libc/pthreads/pthread.h @@ -307,7 +307,20 @@ struct sigevent #define NANOSECOND_PER_TICK (NANOSECOND_PER_SECOND / RT_TICK_PER_SECOND) #ifndef CLOCK_REALTIME -#define CLOCK_REALTIME 0 +#define CLOCK_REALTIME 1 +#endif + +#define CLOCK_CPUTIME_ID 2 + +#ifndef CLOCK_PROCESS_CPUTIME_ID +#define CLOCK_PROCESS_CPUTIME_ID CLOCK_CPUTIME_ID +#endif +#ifndef CLOCK_THREAD_CPUTIME_ID +#define CLOCK_THREAD_CPUTIME_ID CLOCK_CPUTIME_ID +#endif + +#ifndef CLOCK_MONOTONIC +#define CLOCK_MONOTONIC 4 #endif int clock_getres (clockid_t clockid, struct timespec *res); |
