Skip to content

Add a context manager to measure elapsed time

A context manager measuring the elapsed time of a code would be useful:

with Timer() as t:
    # do something

elapsed_time = t.elapsed

We can code something new in GEMSEO or use a dependency, e.g. https://github.com/brouberol/contexttimer which provides also decorators to print or log the execution time of a function.

Edited by Matthias De Lozzo