Start Debugging

diagnostics

3 posts

When is Stopwatch not high resolution in .NET, and what do IsHighResolution and Frequency report on each OS?

On .NET Core and .NET 5+ Stopwatch.IsHighResolution is a hard-coded true and never false. Frequency is whatever QueryPerformanceFrequency says on Windows (usually 10 MHz) and a fixed 1,000,000,000 on Linux, macOS, iOS, Android and WASM, which is a unit, not a resolution. Only .NET Framework can fall back to DateTime. Source walkthrough plus a measured run on .NET 10 / Apple M4 showing 1 ns nominal ticks but 41.67 ns real steps.