timeit

timeit#

class tollan.utils.log.timeit(arg: str, **kwargs)[source]#
class tollan.utils.log.timeit(arg: F)

Bases: ContextDecorator

Decorator/context manager to log execution time of a function or code block.

Uses astropy.utils.human_time for formatting. Can be used as a decorator or with ‘with’ statement.

Return timeit instance.

Methods Summary

__call__(func)

Decorate function to log its execution.

Methods Documentation

__call__(func: Callable) Callable[source]#

Decorate function to log its execution.

Parameters:

func (Callable) – Function to wrap with logging

Returns:

Wrapped function that logs execution

Return type:

Callable