mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-12-22 13:33:40 +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
|
||||
const struct timespec ts =
|
||||
{
|
||||
.tv_sec = ns / 1e9,
|
||||
.tv_nsec = ns - ((ns / 1e9) * 1e9)
|
||||
.tv_sec = ns / 1000000000,
|
||||
.tv_nsec = ns % 1000000000,
|
||||
};
|
||||
nanosleep(&ts, NULL);
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user