Timestamps provides a simple class that allows you to record start time, end time, and gather total runtime for a given operation.
- Initial release
Need help or have feedback? Please file an issue here!
using Timestamps;
void Main(string[] args)
{
Timestamp ts = new Timestamp();
ts.Start = DateTime.UtcNow;
ts.End = DateTime.UtcNow.AddSeconds(10);
Console.WriteLine("Total milliseconds: " + ts.TotalMs + "ms");
// add log messages
ts.AddMessage("Hello, world!");
ts.AddMessage("Hello, but a different world!");
Dictionary<DateTime, string> messages = ts.Messages;
// add metadata
ts.Metadata = myObject; // anything you like
}
Please refer to CHANGELOG.md.