c ++上的精确时间测量 [英] Exact time measurement on c++
本文介绍了c ++上的精确时间测量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在进行一个项目,我必须比较一些排序算法的执行时间。但是,正如你所知,有些值是关闭的,但我看不出差异。我必须知道,差别很小,例如1纳秒或者其他东西。
可以测量非常小的差异 - 小于微秒或其他东西。
I am on a project and i have to compare some sorting algorithms execution times. However, as you know some values are to close, but i can not see difference. I have to know, small difference for example 1 nanosecond or something.
Is that possible to measure very small difference-smaller then microsecond or something.
推荐答案
我写了一个很好的高分辨率C ++秒表类,位于 hwindatetime.h [ ^ ]。
很容易使用许多.Net开发人员都熟悉的界面。
Best问候
Espen Harlinn
I've written a nice high resolution C++ Stopwatch class, located at the bottom of hwindatetime.h[^].
It's easy to use with an interface that should be familiar to many .Net developers.
Best regards
Espen Harlinn
Plase看看:
http://www.informit.com/guides/content.aspx?g=cplusplus&seqNum=272 [ ^ ]
http://stackoverflow.com/questions/1825720/c-high-precision-time-测量窗口 [ ^ ]
http://stackoverflow.com/questions/275 004 / c-timer-function-to-time-in-nano-seconds [ ^ ]
Plase have a look:
http://www.informit.com/guides/content.aspx?g=cplusplus&seqNum=272[^]
http://stackoverflow.com/questions/1825720/c-high-precision-time-measurement-in-windows[^]
http://stackoverflow.com/questions/275004/c-timer-function-to-provide-time-in-nano-seconds[^]
看到这个,它有帮助:
http://stackoverflow.com / questions / 1825720 / c-high-precision-time-measurement-in-windows [ ^ ]
See this, hpoe it helps:
http://stackoverflow.com/questions/1825720/c-high-precision-time-measurement-in-windows[^]
这篇关于c ++上的精确时间测量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文