measureTimedValue<T> function
Executes the given function block and returns an instance of TimedValue class, containing both the result of the function execution and the duration of elapsed time interval.
Implementation
TimedValue<T> measureTimedValue<T>(T Function() block) {
final start = DateTime.now();
final value = block();
return (DateTime.now().difference(start), value);
}