mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-22 05:27:20 +00:00
[common] time: fixed time values in nsleep
Time values of scientific notation replaced with expanded values and `tv_nsec` simplified with modulo
This commit is contained in:
parent
e82f8911a6
commit
7075fe2c54
@ -61,8 +61,8 @@ static inline void nsleep(uint64_t ns)
|
|||||||
#else
|
#else
|
||||||
const struct timespec ts =
|
const struct timespec ts =
|
||||||
{
|
{
|
||||||
.tv_sec = ns / 1e9,
|
.tv_sec = ns / 1000000000,
|
||||||
.tv_nsec = ns - ((ns / 1e9) * 1e9)
|
.tv_nsec = ns % 1000000000,
|
||||||
};
|
};
|
||||||
nanosleep(&ts, NULL);
|
nanosleep(&ts, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user