diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2019-08-27 04:34:32 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-27 04:34:32 (GMT) |
commit | 91020fade6ca0f22eef2d338be1380b17385e715 (patch) | |
tree | fb68a37e7e59d3bc018dc7a918c5701ee9474114 | |
parent | 1d4285a042772c7a31c4e19f8dbcbcf9b2ee3b95 (diff) | |
download | cpython-91020fade6ca0f22eef2d338be1380b17385e715.zip cpython-91020fade6ca0f22eef2d338be1380b17385e715.tar.gz cpython-91020fade6ca0f22eef2d338be1380b17385e715.tar.bz2 |
bpo-36205: Fix the rusage implementation of time.process_time() (GH-15538)
(cherry picked from commit 8bf5fef8737fdd12724b9340d76a4ed391c4ad8a)
Co-authored-by: vrajivk <3413293+vrajivk@users.noreply.github.com>
-rw-r--r-- | Misc/NEWS.d/next/Library/2019-08-27-03-53-26.bpo-36205.AfkGRl.rst | 1 | ||||
-rw-r--r-- | Modules/timemodule.c | 2 |
2 files changed, 2 insertions, 1 deletions
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 index 0000000..50cda34 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2019-08-27-03-53-26.bpo-36205.AfkGRl.rst @@ -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 diff --git a/Modules/timemodule.c b/Modules/timemodule.c index bdc93a2..5e0010c 100644 --- a/Modules/timemodule.c +++ b/Modules/timemodule.c @@ -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; } |