cs-codex-dist-tests/DistTestCore/Stopwatch.cs

20 lines
378 B
C#
Raw Normal View History

2023-04-14 12:53:39 +00:00
using Logging;
using Utils;
namespace DistTestCore
{
public class Stopwatch
{
public static void Measure(BaseLog log, string name, Action action)
{
var start = DateTime.UtcNow;
action();
var duration = DateTime.UtcNow - start;
log.Log($"{name} ({Time.FormatDuration(duration)})");
}
}
}