We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a5cf6c4 commit 70b2e1eCopy full SHA for 70b2e1e
Modules/timemodule.c
@@ -1063,14 +1063,8 @@ static PyObject*
1063
floattime(void)
1064
{
1065
_PyTime_timeval t;
1066
- double secs;
1067
_PyTime_gettimeofday(&t);
1068
- secs = (double)t.tv_sec + t.tv_usec*0.000001;
1069
- if (secs == 0.0) {
1070
- PyErr_SetFromErrno(PyExc_OSError);
1071
- return NULL;
1072
- }
1073
- return PyFloat_FromDouble(secs);
+ return PyFloat_FromDouble((double)t.tv_sec + t.tv_usec * 1e-6);
1074
}
1075
1076
0 commit comments