改变时钟的精度 [英] change clock's precision

查看:208
本文介绍了改变时钟的精度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Env:Win Xp,Visual C ++

Env: Win Xp, Visual C++

我使用clock()来测量程序的时间成本。
但是t_clock总是10的乘法,例如10,20,30,
40,...
我想得到1的精度,如11,12 ,13,14 ...
如何更改t_clock的精度?

I use clock() to measure the time cost in my program. But the t_clock always be the multiply of 10, for example 10, 20, 30, 40,... And I want to get the precision of 1, such as 11, 12, 13, 14... How can I change the t_clock's precision?

感谢

推荐答案

你不能; clock()使用系统的普通RTC。实际需要使用的是高性能计时器。 http://msdn.microsoft.com/en-us/magazine/cc163996.aspx

You can't; clock() uses the system's ordinary RTC. What you actually need to use are High Performance Timers. http://msdn.microsoft.com/en-us/magazine/cc163996.aspx

这篇关于改变时钟的精度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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