Visual C++秒表

tro*_*ana 5 .net stopwatch visual-studio-2010 visual-c++

我想知道在C++中测量某些代码执行时间的最佳方法是什么.是否有内置的秒表(.Net)类?我正在VS2010上开发C++.如何(如果)我可以在我的C++项目中使用.Net库?先感谢您.

pai*_*den 3

AFAIK C++ 还没有像 .NET 中的 Stopwatch 这样的标准类。

http://cplus.about.com/od/howtodothingsi2/a/timing.htm是 Windows 平台上高分辨率计时器的示例。

此类计时器的独立于平台的实现是:http://www.boost.org/libs/timer/doc/index.html

华泰