fixed time unit error in clock_gettime.

This commit is contained in:
weety 2016-06-01 14:07:47 +08:00
parent 11413896d3
commit 0af00b9ce5
1 changed files with 1 additions and 1 deletions

View File

@ -112,7 +112,7 @@ int clock_gettime(clockid_t clockid, struct timespec *tp)
tick = rt_tick_get();
tp->tv_sec = _timevalue.tv_sec + tick / RT_TICK_PER_SECOND;
tp->tv_nsec = (_timevalue.tv_usec + (tick % RT_TICK_PER_SECOND) * NANOSECOND_PER_TICK) * 1000;
tp->tv_nsec = (_timevalue.tv_usec + (tick % RT_TICK_PER_SECOND) * MICROSECOND_PER_TICK) * 1000;
return 0;
}