aboutsummaryrefslogtreecommitdiffstats
path: root/netlib/basethread.py
blob: 7963eb7e7adf711e880aafb64250eb3a93dad80c (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(BaseThread, self).__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)
        )