Created
December 11, 2018 21:18
-
-
Save tomaustin700/3d58b541f22ac8c4d9bca38ea42da65a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static async Task Time(Func<Task> action, EventGauge gauge) | |
{ | |
Stopwatch stopwatch = new Stopwatch(); | |
stopwatch.Start(); | |
await action.Invoke(); | |
stopwatch.Stop(); | |
gauge.Record(stopwatch.Elapsed.TotalMilliseconds, DateTime.Now); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment