##// END OF EJS Templates
Merge pull request !2 from ImplabNet v3...
Merge pull request !2 from ImplabNet v3 Changes from branch: V3

File last commit:

r289:95896f882995 v3.0.14 v3
r294:abef3ebaa230 merge default
Show More
LogicalOperation.cs
26 lines | 647 B | text/x-csharp | CSharpLexer
using System;
using Stopwatch = System.Diagnostics.Stopwatch;
namespace Implab.Diagnostics {
public class LogicalOperation {
readonly Stopwatch m_stopwatch;
public string Name { get; private set; }
internal LogicalOperation(string name) {
Name = string.IsNullOrEmpty(name) ? "<unnamed>" : name;
m_stopwatch = Stopwatch.StartNew();
}
public TimeSpan Elapsed {
get {
return m_stopwatch.Elapsed;
}
}
public void End() {
m_stopwatch.Stop();
}
public override string ToString() => Name;
}
}