Mono上的跨平台高分辨率刻度计数器? [英] Cross-platform high resolution tick counter on Mono?

查看:98
本文介绍了Mono上的跨平台高分辨率刻度计数器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找Mono上的高分辨率滴答计数器,最好与Win32/.NET上的QueryPerformanceCounter分辨率差不多.

I'm looking for a high resolution tick counter on Mono, preferably about the same resolution as a QueryPerformanceCounter on Win32/.NET.

这是我需要支持的每个平台上需要作为本机调用(例如QueryPerformanceCounter在.NET/Win32上)实现的东西吗? (Linux,OSX).

Is this something that needs to be implemented as a native call (like QueryPerformanceCounter is on .NET/Win32) on each platform I need to support? (Linux, OSX).

我需要大约< 1ms的分辨率.

I need about <1ms resolution.

推荐答案

您应该为此使用System.Diagnostics.Stopwatch.

You should use System.Diagnostics.Stopwatch for this.

这篇关于Mono上的跨平台高分辨率刻度计数器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆