[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:
vmfortress 2021-10-30 22:59:14 -04:00 committed by Geoffrey McRae
parent e82f8911a6
commit 7075fe2c54

View File

@ -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