embutils.utils.time module
Timing utilities.
- date
2021
- author
Christian Wiche
- contact
- license
The MIT License (MIT)
- class embutils.utils.time.Timer[source]
Bases:
objectSimple process timer.
This class don’t require any input from the user to be initialized.
- embutils.utils.time.timer(name: typing.Optional[str] = None, logger: typing.Callable[[...], typing.Any] = <built-in function print>, precision: int = 6) Callable[[Callable[[...], Any]], Callable[[...], Any]][source]
Decorator. Used to log the execution time of a function.
- Parameters
name (str) – Timer name. Used to identify the measurement.
logger (CBAny2Any) – Callable used to print the time logs. By default, system print.
precision (float) – Number of decimals included on elapsed time.
- Returns
Decorated function wrapped on timer.
- Return type
Callable[[Callable[…, RT]], Callable[…, RT]]