Skip to content

Commit

Permalink
#779 / proc cpu times: openbsd and netbsd impl
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed Jan 14, 2016
1 parent 5aee97f commit e3e575b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions psutil/_psutil_bsd.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,10 @@ psutil_proc_cpu_times(PyObject *self, PyObject *args) {
#elif defined(__OpenBSD__) || defined(__NetBSD__)
user_t = PSUTIL_KPT2DOUBLE(kp.p_uutime);
sys_t = PSUTIL_KPT2DOUBLE(kp.p_ustime);
// OpenBSD and NetBSD provide children user + system times summed
// together (no distinction).
children_user_t = kp.p_uctime_sec + kp.p_uctime_usec / 1000000.0;
children_sys_t = children_user_t;
#endif
return Py_BuildValue("(dddd)",
user_t, sys_t, children_user_t, children_sys_t);
Expand Down

0 comments on commit e3e575b

Please sign in to comment.