[libc][time] Fix clock_gettime for CLOCK_CPUTIME_ID (#6029)
This commit is contained in:
parent
b197b503c6
commit
ecde6d2dcf
|
@ -616,8 +616,8 @@ int clock_gettime(clockid_t clockid, struct timespec *tp)
|
||||||
unit = clock_cpu_getres();
|
unit = clock_cpu_getres();
|
||||||
cpu_tick = clock_cpu_gettime();
|
cpu_tick = clock_cpu_gettime();
|
||||||
|
|
||||||
tp->tv_sec = ((int)(cpu_tick * unit)) / NANOSECOND_PER_SECOND;
|
tp->tv_sec = ((long long)(cpu_tick * unit)) / NANOSECOND_PER_SECOND;
|
||||||
tp->tv_nsec = ((int)(cpu_tick * unit)) % NANOSECOND_PER_SECOND;
|
tp->tv_nsec = ((long long)(cpu_tick * unit)) % NANOSECOND_PER_SECOND;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue