Skip to content

Commit

Permalink
bpo-36205: Fix the rusage implementation of time.process_time() (GH-1…
Browse files Browse the repository at this point in the history
…5538)

(cherry picked from commit 8bf5fef)

Co-authored-by: vrajivk <3413293+vrajivk@users.noreply.github.com>
  • Loading branch information
miss-islington and vrajivk committed Aug 27, 2019
1 parent 1d4285a commit 91020fa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix the rusage implementation of time.process_time() to correctly report the sum of the system and user CPU time.
2 changes: 1 addition & 1 deletion Modules/timemodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 91020fa

Please sign in to comment.