a984b1f527
Initial commit dunno what has changed.
26 lines
675 B
C#
26 lines
675 B
C#
using System;
|
|
|
|
namespace Tanshu.Accounts.PointOfSale
|
|
{
|
|
public class BlockTimer : IDisposable
|
|
{
|
|
private readonly string _description;
|
|
private readonly long _start;
|
|
|
|
public BlockTimer(string description)
|
|
{
|
|
_description = description;
|
|
_start = DateTime.Now.Ticks;
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
var totalTime = DateTime.Now.Ticks - _start;
|
|
Console.WriteLine(_description);
|
|
Console.Write(" - Total Execution Time: ");
|
|
Console.Write(new TimeSpan(totalTime).TotalMilliseconds.ToString());
|
|
Console.WriteLine(" ms.");
|
|
}
|
|
}
|
|
}
|