File: basethread.py

package info (click to toggle)
mitmproxy 0.18.2-6%2Bdeb9u2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 37,444 kB
  • sloc: python: 33,213; makefile: 167; ansic: 68; sh: 48
file content (14 lines) | stat: -rw-r--r-- 374 bytes parent folder | download
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)
        )