Created
March 23, 2014 09:10
-
-
Save devlights/9720622 to your computer and use it in GitHub Desktop.
Stopwatchでマイクロ秒を算出 (Microseconds, Frequency)
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
using System; | |
using System.Diagnostics; | |
namespace System.Diagnostics.Extensions | |
{ | |
public static class StopwatchExtensions | |
{ | |
public static long ElapsedMicroseconds(this Stopwatch self) | |
{ | |
return (self.ElapsedTicks * (1000 * 1000) / Stopwatch.Frequency); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment