timed<R> function
Implementation
R timed<R>(R block(), {dynamic result(R result, Duration time)?}) {
result ??= (R result, Duration time) {};
final start = DateTime.now();
R r = block();
final duration = DateTime.now().difference(start);
final handled = result(r, duration);
return handled is R ? handled : r;
}