8000 bpo-36205: Fix the rusage implementation of time.process_time() (GH-1… · python/cpython@1bf672f · GitHub
[go: up one dir, main page]

Skip to content

Commit 1bf672f

Browse files
bpo-36205: Fix the rusage implementation of time.process_time() (GH-15538)
(cherry picked from commit 8bf5fef) Co-authored-by: vrajivk <3413293+vrajivk@users.noreply.github.com>
1 parent 31ce015 commit 1bf672f

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix the rusage implementation of time.process_time() to correctly report the sum of the system and user CPU time.

Modules/timemodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1189,7 +1189,7 @@ _PyTime_GetProcessTimeWithInfo(_PyTime_t *tp, _Py_clock_info_t *info)
11891189
return -1;
11901190
}
11911191

1192-
_PyTime_t total = utime + utime;
1192+
_PyTime_t total = utime + stime;
11931193
*tp = total;
11941194
return 0;
11951195
}

0 commit comments

Comments
 (0)
0