annotate Implab/Diagnostics/LogicalOperation.cs @ 255:b00441e04738 v3

Adde workaround to the behaviour of the logical operations stack in conjuction with async/await methods
author cin
date Wed, 04 Apr 2018 15:38:48 +0300
parents 34df34841225
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
253
34df34841225 Implab.Diagnostics drafts
cin
parents:
diff changeset
1 using System;
34df34841225 Implab.Diagnostics drafts
cin
parents:
diff changeset
2 using System.Diagnostics;
34df34841225 Implab.Diagnostics drafts
cin
parents:
diff changeset
3
34df34841225 Implab.Diagnostics drafts
cin
parents:
diff changeset
4 namespace Implab.Diagnostics {
34df34841225 Implab.Diagnostics drafts
cin
parents:
diff changeset
5 public class LogicalOperation {
34df34841225 Implab.Diagnostics drafts
cin
parents:
diff changeset
6 public Stopwatch OperationStopwatch { get; private set; }
34df34841225 Implab.Diagnostics drafts
cin
parents:
diff changeset
7
34df34841225 Implab.Diagnostics drafts
cin
parents:
diff changeset
8 public string Name { get; private set; }
34df34841225 Implab.Diagnostics drafts
cin
parents:
diff changeset
9
34df34841225 Implab.Diagnostics drafts
cin
parents:
diff changeset
10 internal LogicalOperation(string name) {
34df34841225 Implab.Diagnostics drafts
cin
parents:
diff changeset
11 Name = string.IsNullOrEmpty(name) ? "<unnamed>" : name;
34df34841225 Implab.Diagnostics drafts
cin
parents:
diff changeset
12 OperationStopwatch = Stopwatch.StartNew();
34df34841225 Implab.Diagnostics drafts
cin
parents:
diff changeset
13 }
34df34841225 Implab.Diagnostics drafts
cin
parents:
diff changeset
14
34df34841225 Implab.Diagnostics drafts
cin
parents:
diff changeset
15 public override string ToString() => Name;
34df34841225 Implab.Diagnostics drafts
cin
parents:
diff changeset
16 }
34df34841225 Implab.Diagnostics drafts
cin
parents:
diff changeset
17 }