Skip to content

Instantly share code, notes, and snippets.

@kyrathasoft
Last active July 21, 2018 00:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kyrathasoft/99200a2cec68b0914ac2 to your computer and use it in GitHub Desktop.
Save kyrathasoft/99200a2cec68b0914ac2 to your computer and use it in GitHub Desktop.
stopwatch
class AutoStopwatchDemo : System.Diagnostics.Stopwatch, IDisposable
{
public AutoStopwatchDemo()
{
Start();
}
public void Dispose()
{
Stop();
Console.WriteLine(“Elapsed : {0}”, this.Elapsed);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment