Timer
timer
util function used to log the time taken by a part of program
Source code in API/authenticate/utils/timer.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
|
__enter__()
context enter to start write this
Source code in API/authenticate/utils/timer.py
27 28 29 30 31 32 33 |
|
__exit__(context, value, traceback)
context exit will write this
Source code in API/authenticate/utils/timer.py
35 36 37 38 39 40 |
|
__init__(logger, message)
init the timer
Parameters
logger: Logger logger to write the logs message: str message to log, like start xxx
Source code in API/authenticate/utils/timer.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
|