mirror of https://github.com/python/cpython
Revert "gh-123974: Fix time.get_clock_info() on NetBSD (#123975)" (GH-124115)
This reverts commit b1d6f8a2ee
.
This commit is contained in:
parent
29a1a6e3ed
commit
79a7410236
|
@ -1509,19 +1509,15 @@ _PyTime_GetThreadTimeWithInfo(PyTime_t *tp, _Py_clock_info_t *info)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (info) {
|
if (info) {
|
||||||
|
struct timespec res;
|
||||||
info->implementation = function;
|
info->implementation = function;
|
||||||
info->monotonic = 1;
|
info->monotonic = 1;
|
||||||
info->adjustable = 0;
|
info->adjustable = 0;
|
||||||
#if defined(__NetBSD__)
|
|
||||||
info->resolution = 1e-9;
|
|
||||||
#else
|
|
||||||
struct timespec res;
|
|
||||||
if (clock_getres(clk_id, &res)) {
|
if (clock_getres(clk_id, &res)) {
|
||||||
PyErr_SetFromErrno(PyExc_OSError);
|
PyErr_SetFromErrno(PyExc_OSError);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
info->resolution = res.tv_sec + res.tv_nsec * 1e-9;
|
info->resolution = res.tv_sec + res.tv_nsec * 1e-9;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_PyTime_FromTimespec(tp, &ts) < 0) {
|
if (_PyTime_FromTimespec(tp, &ts) < 0) {
|
||||||
|
|
Loading…
Reference in New Issue