From e723bdc56beb77a463603c46e53f319082bfcdb0 Mon Sep 17 00:00:00 2001 From: Nick Craver Date: Sat, 18 Feb 2017 14:50:03 -0500 Subject: [PATCH] Step methods: return Timing (more specific) rater than IDisposable --- src/MiniProfiler.Shared/MiniProfiler.cs | 2 +- src/MiniProfiler.Shared/MiniProfilerExtensions.cs | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/MiniProfiler.Shared/MiniProfiler.cs b/src/MiniProfiler.Shared/MiniProfiler.cs index da6287b3b..7a74a25e8 100644 --- a/src/MiniProfiler.Shared/MiniProfiler.cs +++ b/src/MiniProfiler.Shared/MiniProfiler.cs @@ -355,7 +355,7 @@ public MiniProfiler Clone() } #endif - internal IDisposable StepImpl(string name, decimal? minSaveMs = null, bool? includeChildrenWithMinSave = false) + internal Timing StepImpl(string name, decimal? minSaveMs = null, bool? includeChildrenWithMinSave = false) { return new Timing(this, Head, name, minSaveMs, includeChildrenWithMinSave); } diff --git a/src/MiniProfiler.Shared/MiniProfilerExtensions.cs b/src/MiniProfiler.Shared/MiniProfilerExtensions.cs index 143cddca0..a3d5a6b5f 100644 --- a/src/MiniProfiler.Shared/MiniProfilerExtensions.cs +++ b/src/MiniProfiler.Shared/MiniProfilerExtensions.cs @@ -28,26 +28,26 @@ public static T Inline(this MiniProfiler profiler, Func selector, string n } /// - /// Returns an that will time the code between its creation and disposal. + /// Returns an () that will time the code between its creation and disposal. /// /// The current profiling session or null. - /// A descriptive name for the code that is encapsulated by the resulting IDisposable's lifetime. + /// A descriptive name for the code that is encapsulated by the resulting Timing's lifetime. /// the profile step - public static IDisposable Step(this MiniProfiler profiler, string name) => profiler?.StepImpl(name); + public static Timing Step(this MiniProfiler profiler, string name) => profiler?.StepImpl(name); /// - /// Returns an that will time the code between its creation and disposal. + /// Returns an () that will time the code between its creation and disposal. /// Will only save the if total time taken exceeds . /// - /// The current profiling session or null. - /// A descriptive name for the code that is encapsulated by the resulting IDisposable's lifetime. + /// The current profiling session or null. + /// A descriptive name for the code that is encapsulated by the resulting Timing's lifetime. /// The minimum amount of time that needs to elapse in order for this result to be recorded. /// Should the amount of time spent in child timings be included when comparing total time /// profiled with ? If true, will include children. If false will ignore children. /// /// If is set to true and a child is removed due to its use of StepIf, then the /// time spent in that time will also not count for the current StepIf calculation. - public static IDisposable StepIf(this MiniProfiler profiler, string name, decimal minSaveMs, bool includeChildren = false) + public static Timing StepIf(this MiniProfiler profiler, string name, decimal minSaveMs, bool includeChildren = false) { return profiler?.StepImpl(name, minSaveMs, includeChildren); }