mirror of
https://github.com/w-okada/voice-changer.git
synced 2025-01-24 05:55:01 +03:00
16 lines
330 B
Python
16 lines
330 B
Python
|
import time
|
||
|
|
||
|
|
||
|
class Timer(object):
|
||
|
def __init__(self, title: str):
|
||
|
self.title = title
|
||
|
|
||
|
def __enter__(self):
|
||
|
self.start = time.time()
|
||
|
return self
|
||
|
|
||
|
def __exit__(self, *_):
|
||
|
self.end = time.time()
|
||
|
self.secs = self.end - self.start
|
||
|
self.msecs = self.secs * 1000 # millisecs
|