Last active
June 18, 2016 15:55
-
-
Save i3arnon/fc61ba3ef9553e0e048eb8d14aaa5dc2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// * Detailed results * | |
Program_GetSystemTimeAsFileTime | |
Mean = 15.0677 ns, StdError = 0.0775 ns (0.51%); N = 60, StdDev = 0.6000 ns | |
Min = 14.3962 ns, Q1 = 14.6196 ns, Median = 14.8500 ns, Q3 = 15.3732 ns, Max = 17.0593 ns | |
IQR = 0.7536 ns, LowerFence = 13.4891 ns, UpperFence = 16.5036 ns | |
ConfidenceInterval = [14.9159 ns; 15.2195 ns] (CI 95%) | |
Program_UtcNow | |
Mean = 5.0350 ns, StdError = 0.0096 ns (0.19%); N = 110, StdDev = 0.1007 ns | |
Min = 4.9268 ns, Q1 = 4.9695 ns, Median = 4.9905 ns, Q3 = 5.0597 ns, Max = 5.4673 ns | |
IQR = 0.0902 ns, LowerFence = 4.8343 ns, UpperFence = 5.1949 ns | |
ConfidenceInterval = [5.0162 ns; 5.0538 ns] (CI 95%) | |
Total time: 00:02:05 (125.07 sec) | |
// * Summary * | |
BenchmarkDotNet=v0.9.4.0 | |
OS=Microsoft Windows NT 6.2.9200.0 | |
Processor=Intel(R) Core(TM) i7-4800MQ CPU @ 2.70GHz, ProcessorCount=8 | |
Frequency=2630623 ticks, Resolution=380.1381 ns, Timer=TSC | |
HostCLR=MS.NET 4.0.30319.42000, Arch=32-bit RELEASE | |
JitModules=clrjit-v4.6.1080.0 | |
Type=Program Mode=Throughput | |
Method | Median | StdDev | | |
------------------------ |----------- |---------- | | |
GetSystemTimeAsFileTime | 14.8500 ns | 0.6000 ns | | |
UtcNow | 4.9905 ns | 0.1007 ns | | |
// ***** BenchmarkRunner: End ***** |
This file contains hidden or 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 Program | |
{ | |
static void Main() => BenchmarkRunner.Run<Program>(); | |
[Benchmark] | |
public DateTime UtcNow() => DateTime.UtcNow; | |
[Benchmark] | |
public unsafe long GetSystemTimeAsFileTime() | |
{ | |
long fileTime; | |
GetSystemTimeAsFileTime(&fileTime); | |
return fileTime; | |
} | |
[DllImport("kernel32.dll")] | |
public static extern unsafe void GetSystemTimeAsFileTime(long* systemTimeAsFileTime); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment