Created
March 1, 2011 11:26
-
-
Save robfe/848998 to your computer and use it in GitHub Desktop.
Silverlight compatible version of https://gist.github.com/460096
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CodeTimer : IDisposable | |
{ | |
readonly string message; | |
readonly DateTime start; | |
public CodeTimer(string message) | |
{ | |
this.message = message; | |
start = DateTime.UtcNow; | |
} | |
public void Dispose() | |
{ | |
DateTime end = DateTime.UtcNow; | |
Debug.WriteLine("{0} took {1} msec", message, (end - start).TotalMilliseconds); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment