diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-03-27 17:16:17 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-03-27 17:16:17 (GMT) |
commit | a47b881d86d46ba7c1ee3e007448339e1ed5e2d3 (patch) | |
tree | 80c5c02954314a3fb3da42966a315ac3eb6f6bd5 /Modules | |
parent | 4bfb460d883bd224b61a0e7403a09ea093947890 (diff) | |
download | cpython-a47b881d86d46ba7c1ee3e007448339e1ed5e2d3.zip cpython-a47b881d86d46ba7c1ee3e007448339e1ed5e2d3.tar.gz cpython-a47b881d86d46ba7c1ee3e007448339e1ed5e2d3.tar.bz2 |
Issue #22117: time.time() now uses the new _PyTime_t API
* Add _PyTime_GetSystemClockWithInfo()
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/timemodule.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Modules/timemodule.c b/Modules/timemodule.c index 6563d83..880f3d2 100644 --- a/Modules/timemodule.c +++ b/Modules/timemodule.c @@ -1372,12 +1372,14 @@ PyInit_time(void) static PyObject* floattime(_Py_clock_info_t *info) { - _PyTime_timeval t; - if (_PyTime_gettimeofday_info(&t, info) < 0) { + _PyTime_t t; + double d; + if (_PyTime_GetSystemClockWithInfo(&t, info) < 0) { assert(info != NULL); return NULL; } - return PyFloat_FromDouble((double)t.tv_sec + t.tv_usec * 1e-6); + d = _PyTime_AsSecondsDouble(t); + return PyFloat_FromDouble(d); } |