在 Windows 上,在 C# 中,Stopwatch.GetTimestamp() 是单调的,因为它使用 QueryPerformanceCounter() (请参阅https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.stopwatch?view=网络框架-4.8)。QueryPerformanceCounter 也被 C++ 的 std::steady_clock 的 Microsoft 实现使用,保证是单调的(请参阅https://en.cppreference.com/w/cpp/chrono/steady_clock)。
当使用Linux,.NET Core 3.1时,有谁知道这个方法是否使用保证单调的时钟(假设静态IsHighResolution属性为true)?
| 归档时间: |
|
| 查看次数: |
1210 次 |
| 最近记录: |