1 #include <assert.h> 2 #include <time.h> 3 main()4int main() { 5 struct timespec ts; 6 int r; 7 8 // supported clocks 9 r = clock_getres(CLOCK_REALTIME, &ts); 10 assert(r == 0); 11 r = clock_getres(CLOCK_MONOTONIC, &ts); 12 assert(r == 0); 13 r = clock_getres(CLOCK_PROCESS_CPUTIME_ID, &ts); 14 assert(r == 0); 15 r = clock_getres(CLOCK_THREAD_CPUTIME_ID, &ts); 16 assert(r == 0); 17 } 18