We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6020cdb commit 781c27aCopy full SHA for 781c27a
arch/sim/src/sim/sim_oneshot.c
@@ -113,15 +113,10 @@ static const struct oneshot_operations_s g_oneshot_ops =
113
114
static inline void sim_timer_current(struct timespec *ts)
115
{
116
- uint64_t nsec;
117
- time_t sec;
118
-
119
- nsec = host_gettime(false);
120
- sec = nsec / NSEC_PER_SEC;
121
- nsec -= sec * NSEC_PER_SEC;
+ uint64_t nsec = host_gettime(false);
122
123
- ts->tv_sec = sec;
124
- ts->tv_nsec = nsec;
+ ts->tv_sec = nsec / NSEC_PER_SEC;
+ ts->tv_nsec = nsec % NSEC_PER_SEC;
125
}
126
127
/****************************************************************************
0 commit comments