/// <summary> /// Shows a sample loop where an action is executed, and the latency of each execution is recorded. /// </summary> private static void RecordMeasurements() { var timer = Stopwatch.StartNew(); do { Histogram.RecordLatency(CreateAndCloseDatagramSocket); } while (timer.Elapsed < RunPeriod); }