Browse Source

Update CodeTimer with optional postfix

pull/165/head
Ionite 1 year ago
parent
commit
40ea8f8b81
No known key found for this signature in database
  1. 4
      StabilityMatrix.Core/Helper/CodeTimer.cs

4
StabilityMatrix.Core/Helper/CodeTimer.cs

@ -14,9 +14,9 @@ public class CodeTimer : IDisposable
private CodeTimer? ParentTimer { get; }
private List<CodeTimer> SubTimers { get; } = new();
public CodeTimer([CallerMemberName] string? name = null)
public CodeTimer(string postFix = "", [CallerMemberName] string callerName = "")
{
this.name = name ?? "";
name = $"{callerName}" + (string.IsNullOrEmpty(postFix) ? "" : $" ({postFix})");
stopwatch = Stopwatch.StartNew();
// Set parent as the top of the stack

Loading…
Cancel
Save