]> granicus.if.org Git - python/commitdiff
bpo-36205: Fix the rusage implementation of time.process_time() (GH-15538)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 27 Aug 2019 04:34:32 +0000 (21:34 -0700)
committerGitHub <noreply@github.com>
Tue, 27 Aug 2019 04:34:32 +0000 (21:34 -0700)
(cherry picked from commit 8bf5fef8737fdd12724b9340d76a4ed391c4ad8a)

Co-authored-by: vrajivk <3413293+vrajivk@users.noreply.github.com>
Misc/NEWS.d/next/Library/2019-08-27-03-53-26.bpo-36205.AfkGRl.rst [new file with mode: 0644]
Modules/timemodule.c

diff --git a/Misc/NEWS.d/next/Library/2019-08-27-03-53-26.bpo-36205.AfkGRl.rst b/Misc/NEWS.d/next/Library/2019-08-27-03-53-26.bpo-36205.AfkGRl.rst
new file mode 100644 (file)
index 0000000..50cda34
--- /dev/null
@@ -0,0 +1 @@
+Fix the rusage implementation of time.process_time() to correctly report the sum of the system and user CPU time.
\ No newline at end of file
index bdc93a2b7ec1eb484e4eb63ae38fae6dd033a6fa..5e0010c8a81996534ba210d388fd0d0c3a17281c 100644 (file)
@@ -1208,7 +1208,7 @@ _PyTime_GetProcessTimeWithInfo(_PyTime_t *tp, _Py_clock_info_t *info)
             return -1;
         }
 
-        _PyTime_t total = utime + utime;
+        _PyTime_t total = utime + stime;
         *tp = total;
         return 0;
     }