QueryPerformanceCounter (kernel32)
Last changed: -178.94.101.155

.
Summary

C# Signature:

[DllImport("kernel32.dll")]
static extern bool QueryPerformanceCounter(out long lpPerformanceCount);

User-Defined Types:

None.

Notes:

None.

Tips & Tricks:

For this particular method, execution time is often critical. Security can be traded for additional speed by applying the SuppressUnmanagedCodeSecurity attribute to the method declaration. This will prevent the runtime from doing a security stack walk at runtime.

[DllImport("kernel32.dll"),SuppressUnmanagedCodeSecurity]
static extern bool QueryPerformanceCounter(out long lpPerformanceCount);

Sample Code:

Please add some!

Alternative Managed API:

Do you know one? Please contribute it!

Documentation