diff options
Diffstat (limited to 'mitmproxy/coretypes/basethread.py')
-rw-r--r-- | mitmproxy/coretypes/basethread.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/mitmproxy/coretypes/basethread.py b/mitmproxy/coretypes/basethread.py new file mode 100644 index 00000000..a3c81d19 --- /dev/null +++ b/mitmproxy/coretypes/basethread.py @@ -0,0 +1,14 @@ +import time +import threading + + +class BaseThread(threading.Thread): + def __init__(self, name, *args, **kwargs): + super().__init__(name=name, *args, **kwargs) + self._thread_started = time.time() + + def _threadinfo(self): + return "%s - age: %is" % ( + self.name, + int(time.time() - self._thread_started) + ) |