Skip to content

jchristn/Timestamps

Repository files navigation

timestamps

Timestamps

Simple class with start time, end time, and total time, useful for measuring operational runtime.

NuGet Version NuGet

Timestamps provides a simple class that allows you to record start time, end time, and gather total runtime for a given operation.

New in v1.0.x

  • Initial release

Help or Feedback

Need help or have feedback? Please file an issue here!

Simple Examples

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
}

Version History

Please refer to CHANGELOG.md.

About

Simple class containing start time, end time, and total time.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages