如何获得一段代码执行所花的精确时间?
Posted on 八月 16rd, 2007 由 admin
ctime好像不行呀?
推荐阅读
网友:mfc168
在代码执行的开始:ctime::getcurrenttime
执行结束:ctime::getcurrenttime
取得的两个结果的差,就是你想要的时间 ctimespan 类型
网友:lygfqy
gettickcount();
代码前后相减
网友:fengge8ylf
queryperformancecounter()
网友:wangjinwang
dword s=gettickcount();
//你的代码
s=gettickcount()-s;//毫秒数


讨论区