Definition at line 27 of file utils.py.
◆ __init__()
def utils.print_timings.__init__ |
( |
|
self | ) |
|
Definition at line 28 of file utils.py.
28 def __init__(self):
29 self._start = None
30
◆ __enter__()
def utils.print_timings.__enter__ |
( |
|
self | ) |
|
Definition at line 31 of file utils.py.
31 def __enter__(self):
32 self._start = datetime.datetime.utcnow()
33 print(
'Task started at %s GMT' % str(self._start))
34
def print(*args, **kwargs)
◆ __exit__()
def utils.print_timings.__exit__ |
( |
|
self, |
|
|
|
t, |
|
|
|
v, |
|
|
|
tb |
|
) |
| |
Definition at line 35 of file utils.py.
35 def __exit__(self, t, v, tb):
36 finish = datetime.datetime.utcnow()
37 duration = (finish-self._start).total_seconds()
38 print(
'Task finished at %s GMT (%f seconds)' % (str(finish), duration))
39
40
The documentation for this class was generated from the following file: