##// END OF EJS Templates
major update, added Drain mathod to AsyncQueue class
major update, added Drain mathod to AsyncQueue class

File last commit:

r92:4c0e5ef99986 v2
r124:a336cb13c6a9 v2
Show More
LogicalOperation.cs
45 lines | 1.2 KiB | text/x-csharp | CSharpLexer
cin
initial log capabilities
r35 using System;
namespace Implab.Diagnostics {
public class LogicalOperation {
cin
rewritten tracing
r92 public static readonly LogicalOperation EMPTY = new LogicalOperation("__EMPTY__", null);
cin
initial log capabilities
r35 readonly LogicalOperation m_parent;
readonly string m_name;
readonly int m_level;
readonly int m_timestamp;
public LogicalOperation()
: this(null, null) {
}
public LogicalOperation(string name, LogicalOperation parent) {
m_name = name ?? String.Empty;
m_parent = parent;
m_level = parent == null ? 0 : parent.Level + 1;
m_timestamp = Environment.TickCount;
}
public int Duration {
get {
var dt = Environment.TickCount - m_timestamp;
return dt < 0 ? int.MaxValue + dt : dt; // handle overflow
}
}
public LogicalOperation Parent {
get {
return m_parent;
}
}
public int Level {
get { return m_level; }
}
public string Name {
get { return m_name; }
}
}
}