Class LogTime
Automatic time tracing, like "using ( new LogTime( true ) ) { /* your code */ }"
Inheritance
System.Object
LogTime
Namespace: Cobasoft
Assembly: Cobasoft.Log.dll
Syntax
public class LogTime : IDisposable
Constructors
LogTime(Boolean, Boolean, String, String, Int32)
Constructor with options, but without additional strings.
Declaration
public LogTime(bool show = true, bool memory = false, string member = null, string source = null, int line = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | show | |
System.Boolean | memory | |
System.String | member | |
System.String | source | |
System.Int32 | line |
LogTime(String, Boolean, String, String, Int32)
Constructor with one additional string and options.
Declaration
public LogTime(string first, bool memory = false, string member = null, string source = null, int line = 0)
Parameters
Type | Name | Description |
---|---|---|
System.String | first | |
System.Boolean | memory | |
System.String | member | |
System.String | source | |
System.Int32 | line |
LogTime(String, String, Boolean, Boolean, String, String, Int32)
Constructor with two additional strings and options.
Declaration
public LogTime(string clss, string method, bool show = false, bool memory = false, string member = null, string source = null, int line = 0)
Parameters
Type | Name | Description |
---|---|---|
System.String | clss | |
System.String | method | |
System.Boolean | show | |
System.Boolean | memory | |
System.String | member | |
System.String | source | |
System.Int32 | line |
Properties
Elapsed
Get the currently elapsed time in milliseconds.
Declaration
public uint Elapsed { get; }
Property Value
Type | Description |
---|---|
System.UInt32 |
Final
Get the Final string.
Declaration
public string Final { get; }
Property Value
Type | Description |
---|---|
System.String |
First
Get the First string.
Declaration
public string First { get; }
Property Value
Type | Description |
---|---|
System.String |
Line
Get the Line value.
Declaration
public int Line { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Member
Get the Member name.
Declaration
public string Member { get; }
Property Value
Type | Description |
---|---|
System.String |
Source
Get the Source string.
Declaration
public string Source { get; }
Property Value
Type | Description |
---|---|
System.String |
Title
Get the Title.
Declaration
public string Title { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
Dispose()
Declaration
public void Dispose()
SetFinal(String)
Set the Final string. This is shown when the final timing record is written into the Log.
Declaration
public void SetFinal(string msg)
Parameters
Type | Name | Description |
---|---|---|
System.String | msg |
Show(String)
Write additional timing information.
Declaration
public void Show(string msg = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | msg |
Stop(String, Boolean)
Write additional timing information.
Declaration
public void Stop(string msg = null, bool restart = true)
Parameters
Type | Name | Description |
---|---|---|
System.String | msg | |
System.Boolean | restart |
Write(Boolean, String, Boolean)
Write additional timing information.
Declaration
public void Write(bool final, string msg = null, bool restart = true)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | final | |
System.String | msg | |
System.Boolean | restart |