diff --git a/Misc/NEWS.d/next/Library/2025-06-09-17-33-49.gh-issue-135304.GN747s.rst b/Misc/NEWS.d/next/Library/2025-06-09-17-33-49.gh-issue-135304.GN747s.rst new file mode 100644 index 00000000000000..10aa10c1bb6eed --- /dev/null +++ b/Misc/NEWS.d/next/Library/2025-06-09-17-33-49.gh-issue-135304.GN747s.rst @@ -0,0 +1,2 @@ +Fix reported resolution of :func:`time.process_time` and +:func:`time.thread_time` on Windows. Patch by Chris Eibl. diff --git a/Modules/timemodule.c b/Modules/timemodule.c index 3271d87ddc27f2..182957d5711078 100644 --- a/Modules/timemodule.c +++ b/Modules/timemodule.c @@ -1307,7 +1307,7 @@ py_process_time(time_module_state *state, PyTime_t *tp, if (info) { info->implementation = "GetProcessTimes()"; - info->resolution = 1e-7; + info->resolution = 15.625e-3; info->monotonic = 1; info->adjustable = 0; } @@ -1468,7 +1468,7 @@ _PyTime_GetThreadTimeWithInfo(PyTime_t *tp, _Py_clock_info_t *info) if (info) { info->implementation = "GetThreadTimes()"; - info->resolution = 1e-7; + info->resolution = 15.625e-3; info->monotonic = 1; info->adjustable = 0; }