diff --git a/synapse/util/logcontext.py b/synapse/util/logcontext.py index 8a36bbf32d..8c57671b66 100644 --- a/synapse/util/logcontext.py +++ b/synapse/util/logcontext.py @@ -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):