public static IDisposable LogWaitCopyDurationOfScope(this StreamingEventSource log, ulong iteration) { var durationStopwatch = Stopwatch.StartNew(); return(Disposable.Create( () => { durationStopwatch.Stop(); StreamingEventSource.Log.WaitOnBufferCopyDuration(iteration, durationStopwatch.ElapsedTicks * NanoSecondsPerTick); })); }
public static IDisposable LogDurationOfScope(this StreamingEventSource log, Func <TimeSpan, string> logMessageFunc) { var durationStopwatch = Stopwatch.StartNew(); return(Disposable.Create( () => { durationStopwatch.Stop(); StreamingEventSource.Log.Duration(logMessageFunc(durationStopwatch.Elapsed), durationStopwatch.ElapsedTicks * NanoSecondsPerTick); })); }
public static IDisposable LogGrabDurationOfScope(this StreamingEventSource log, ulong iteration, uint bufferSize) { var durationStopwatch = Stopwatch.StartNew(); StreamingEventSource.Log.StartGrabbing(iteration, bufferSize); return(Disposable.Create( () => { durationStopwatch.Stop(); StreamingEventSource.Log.GrabDuration(iteration, durationStopwatch.ElapsedTicks * NanoSecondsPerTick); })); }
public static IDisposable LogDurationOfScope(this StreamingEventSource log, string messageFormat, params object[] options) { var message = string.Format(CultureInfo.InvariantCulture, messageFormat, options); return(LogDurationOfScope(log, _ => message)); }
public static IDisposable LogDurationOfScope(this StreamingEventSource log, string message) { return(LogDurationOfScope(log, _ => message)); }