usleep: use div_const to optimize the usleep

Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
ligd
2024-07-29 17:07:46 +08:00
committed by Xiang Xiao
parent 62047aa3d0
commit f0d3c8ab2b
7 changed files with 23 additions and 10 deletions
+1 -1
View File
@@ -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;