Created
March 27, 2014 07:53
-
-
Save Cotoff/9802465 to your computer and use it in GitHub Desktop.
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
class Timer : IDisposable | |
{ | |
private readonly string m_Text; | |
private Stopwatch m_Stopwatch; | |
public Timer(string text) | |
{ | |
m_Text = text; | |
m_Stopwatch = Stopwatch.StartNew(); | |
} | |
public void Dispose() | |
{ | |
m_Stopwatch.Stop(); | |
Debug.Log(string.Format("Profiled {0}: {1:0.00}ms", m_Text, m_Stopwatch.ElapsedMilliseconds)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment