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
.Diagnostics
7 public partial class Stopwatch
9 private static unsafe long QueryPerformanceFrequency()
13 Interop
.BOOL result
= Interop
.Kernel32
.QueryPerformanceFrequency(&resolution
);
14 // The P/Invoke is documented to never fail on Windows XP or later
15 Debug
.Assert(result
!= Interop
.BOOL
.FALSE
);
20 private static unsafe long QueryPerformanceCounter()
24 Interop
.BOOL result
= Interop
.Kernel32
.QueryPerformanceCounter(×tamp
);
25 // The P/Invoke is documented to never fail on Windows XP or later
26 Debug
.Assert(result
!= Interop
.BOOL
.FALSE
);