mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 09:18:00 +08:00
Replece clock_gettime(CLOCK_MONOTONIC) with clock_systime_timespec
it's better to call the kernrel api insteaad user space api in kernel Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
@@ -204,7 +204,7 @@ static inline uint64_t touch_get_time(void)
|
||||
{
|
||||
struct timespec ts;
|
||||
|
||||
clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||
clock_systime_timespec(&ts);
|
||||
return 1000000ull * ts.tv_sec + ts.tv_nsec / 1000;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ static inline uint64_t lirc_get_timestamp(void)
|
||||
{
|
||||
struct timespec ts;
|
||||
|
||||
clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||
clock_systime_timespec(&ts);
|
||||
return 1000000000ull * ts.tv_sec + ts.tv_nsec;
|
||||
}
|
||||
|
||||
|
||||
@@ -283,7 +283,7 @@ static inline uint64_t sensor_get_timestamp(void)
|
||||
{
|
||||
struct timespec ts;
|
||||
|
||||
clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||
clock_systime_timespec(&ts);
|
||||
return 1000000ull * ts.tv_sec + ts.tv_nsec / 1000;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user