mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 20:08:15 +08:00
usleep: use div_const to optimize the usleep
Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
@@ -78,7 +78,7 @@ int gettimeofday(FAR struct timeval *tv, FAR struct timezone *tz)
|
||||
/* Convert the struct timespec to a struct timeval */
|
||||
|
||||
tv->tv_sec = ts.tv_sec;
|
||||
tv->tv_usec = ts.tv_nsec / NSEC_PER_USEC;
|
||||
tv->tv_usec = NSEC2USEC(ts.tv_nsec);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user