Skip to content

Instantly share code, notes, and snippets.

@jonathascosta
Last active December 11, 2015 03:48
Show Gist options
  • Select an option

  • Save jonathascosta/4540519 to your computer and use it in GitHub Desktop.

Select an option

Save jonathascosta/4540519 to your computer and use it in GitHub Desktop.
Stopwatch snippet
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippet Format="1.0.0" xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<Header>
<Title>Stopwatch</Title>
<Author>Jonathas Piazzarollo Costa</Author>
<Shortcut>stopwatch</Shortcut>
<Description>Surrounds code with Stopwatch.</Description>
<SnippetTypes>
<SnippetType>SurroundsWith</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<References>
<Reference>
<Assembly>System.Diagnostics</Assembly>
</Reference>
</References>
<Code Language="csharp">
<![CDATA[System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
sw.Start();
$selected$
sw.Stop();
System.Diagnostics.Debug.WriteLine("{0} seconds", sw.Elapsed.TotalSeconds);]]>
</Code>
</Snippet>
</CodeSnippet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment