linux: ignore fractional time in uv_uptime()
Before this commit, uv_uptime() returned the nanoseconds as the fractional part of the uptime. It's a bit inconsistent with the output on other platforms because those only return whole seconds (with the possible exception of Windows.) This commit changes linux-core.c to only return whole seconds.
This commit is contained in:
parent
a1e159f04e
commit
556fe1a659
@ -368,7 +368,6 @@ int uv_uptime(double* uptime) {
|
||||
return -errno;
|
||||
|
||||
*uptime = now.tv_sec;
|
||||
*uptime += (double)now.tv_nsec / 1000000000.0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user