aboutsummaryrefslogtreecommitdiffstats
path: root/mitmproxy/coretypes/basethread.py
blob: a3c81d196840103300204aa64660f19a45d717d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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)
        )