Breaking Changes. Upgrade Script in Sql directory. Deployed
This commit is contained in:
28
Tanshu.Accounts.PointOfSale/Profiling/BlockTimer.cs
Normal file
28
Tanshu.Accounts.PointOfSale/Profiling/BlockTimer.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Tanshu.Accounts.PointOfSale
|
||||
{
|
||||
public class BlockTimer : IDisposable
|
||||
{
|
||||
private string _description;
|
||||
private long _start;
|
||||
|
||||
public BlockTimer(string description)
|
||||
{
|
||||
_description = description;
|
||||
_start = DateTime.Now.Ticks;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
long totalTime = DateTime.Now.Ticks - _start;
|
||||
Console.WriteLine(_description);
|
||||
Console.Write(" - Total Execution Time: ");
|
||||
Console.Write(new TimeSpan(totalTime).TotalMilliseconds.ToString());
|
||||
Console.WriteLine(" ms.");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user