pcdsdevices.utils.measure_time
- pcdsdevices.utils.measure_time(func)
Decorate a function to log its execution time at the DEBUG level.
Measure elapsed time using
time.perf_counter()and log the function name and duration in seconds, even if the function raises an exception.- Parameters:
func (callable) – Function whose execution time is to be measured.
- Returns:
callable – Wrapped function that accepts the original arguments, returns the original result, and preserves the original function’s metadata.