From 3612b854956742790f58dcb07a6d50cc4f9b81b8 Mon Sep 17 00:00:00 2001 From: Nikhil Marathe Date: Fri, 15 Jun 2018 21:49:30 +0530 Subject: [PATCH] Add seconds to thread run times on MacOS. (#1292) Add seconds to thread run times on MacOS (fix #1278) --- psutil/_psutil_osx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/psutil/_psutil_osx.c b/psutil/_psutil_osx.c index 19508723a..b8e3b85d2 100644 --- a/psutil/_psutil_osx.c +++ b/psutil/_psutil_osx.c @@ -1097,8 +1097,10 @@ psutil_proc_threads(PyObject *self, PyObject *args) { py_tuple = Py_BuildValue( "Iff", j + 1, - (float)basic_info_th->user_time.microseconds / 1000000.0, - (float)basic_info_th->system_time.microseconds / 1000000.0 + basic_info_th->user_time.seconds + \ + (float)basic_info_th->user_time.microseconds / 1000000.0, + basic_info_th->system_time.seconds + \ + (float)basic_info_th->system_time.microseconds / 1000000.0 ); if (!py_tuple) goto error;