Cheekily use RUSAGE_THREAD

This commit is contained in:
Erik Johnston 2015-08-19 09:26:14 +01:00
parent 43349a7b43
commit 118bb5c036
1 changed files with 2 additions and 1 deletions

View File

@ -23,7 +23,8 @@ logger = logging.getLogger(__name__)
def _get_cpu_time():
return getrusage(RUSAGE_SELF).ru_utime * 1000
# Cheekily use RUSAGE_THREAD. THIS IS NOT PORTABLE
return getrusage(1).ru_utime * 1000
class LoggingContext(object):