[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 authored and Geoffrey McRae committed 2021-11-01 20:58:42 +11:00
1 parent e82f8911a6
commit 7075fe2c54
1 file changed
+2 -2
+2 -2
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