diff --git a/agent/protect.c b/agent/protect.c --- a/agent/protect.c +++ b/agent/protect.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -104,6 +105,12 @@ &data->creation_time, &data->exit_time, &data->kernel_time, &data->user_time); # endif +#elif defined (CLOCK_THREAD_CPUTIME_ID) + struct timespec tmp; + + clock_gettime (CLOCK_THREAD_CPUTIME_ID, &tmp); + data->ticks = (clock_t)(((unsigned long long)tmp.tv_sec * 1000000000 + + tmp.tv_nsec) * CLOCKS_PER_SEC / 1000000000); #else struct tms tmp;