Improve Dictionary TryGetValue size/perfomance (dotnet/coreclr#27195)
[mono-project.git] / netcore / System.Private.CoreLib / shared / System / HighPerformanceCounter.Windows.cs
blob1bd40ab843ac8193addfeb886d0cbd9422334526
1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
5 namespace System
7 internal static unsafe class HighPerformanceCounter
9 public static ulong TickCount
11 get
13 long counter;
14 Interop.Kernel32.QueryPerformanceCounter(&counter);
15 return (ulong)counter;
19 public static ulong Frequency { get; } = GetFrequency();
21 private static ulong GetFrequency()
23 long frequency;
24 Interop.Kernel32.QueryPerformanceFrequency(&frequency);
25 return (ulong)frequency;