|
|
@ -14,9 +14,9 @@ public class CodeTimer : IDisposable |
|
|
|
private CodeTimer? ParentTimer { get; } |
|
|
|
private CodeTimer? ParentTimer { get; } |
|
|
|
private List<CodeTimer> SubTimers { get; } = new(); |
|
|
|
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(); |
|
|
|
stopwatch = Stopwatch.StartNew(); |
|
|
|
|
|
|
|
|
|
|
|
// Set parent as the top of the stack |
|
|
|
// Set parent as the top of the stack |
|
|
|