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.
7 internal static unsafe class HighPerformanceCounter
9 public static ulong TickCount
14 Interop
.Kernel32
.QueryPerformanceCounter(&counter
);
15 return (ulong)counter
;
19 public static ulong Frequency { get; }
= GetFrequency();
21 private static ulong GetFrequency()
24 Interop
.Kernel32
.QueryPerformanceFrequency(&frequency
);
25 return (ulong)frequency
;