24小时热门版块排行榜    

CyRhmU.jpeg
查看: 1636  |  回复: 9
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

ppc

至尊木虫 (正式写手)

[交流] 关于Matlab的计时已有7人参与

在matlab里面怎么计时比较正确?发现tic/toc和cputime的计时差别比较大
matlab的手册说得也比较模糊

Using tic and toc Versus the cputime Function

Although it is possible to measure performance using the cputime function, it is recommended that you use the tic and toc functions for this purpose exclusively. It has been the general rule for CPU-intensive calculations run on Microsoft Windows machines that the elapsed time using cputime and the elapsed time using tic and toc are close in value, ignoring any first time costs. There are cases however that show a significant difference between these two methods. For example, in the case of a Pentium 4 with hyperthreading running Windows, there can be a significant difference between the values returned by cputime versus tic and toc.
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

woshilsh

荣誉版主 (职业作家)

优秀版主

★ ★
小木虫(金币+0.5):给个红包,谢谢回帖
jjdg: 感谢回复 2011-05-21 00:50:46
微尘、梦想(金币+1): 2011-05-21 19:16:58
偶发论文的时候都是用tic/toc的,看大牛们也是用这个
[center][url=http://www.91cool.net/][img]http://id.91cool.net/sign/?name=小木虫印&say=各位版主辛苦了![/img][/url][/center]
3楼2011-05-20 22:57:07
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
查看全部 10 个回答

libralibra

至尊木虫 (著名写手)

骠骑将军

★ ★
小木虫(金币+0.5):给个红包,谢谢回帖
jjdg: 感谢参与回复 2011-05-21 00:50:54
微尘、梦想(金币+1): 2011-05-21 19:16:51
一般就tic/toc,没人要求那么精确吧
matlab/VB/python/c++/Java写程序请发QQ邮件:790404545@qq.com
2楼2011-05-20 21:12:08
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

cyl1124

荣誉版主 (文坛精英)

花花帅虫

优秀版主优秀版主

★ ★
小木虫(金币+0.5):给个红包,谢谢回帖
jjdg: 感谢回复 2011-05-21 00:50:37
微尘、梦想(金币+1): 2011-05-21 19:17:06
tic/toc
介个常用
花花帅虫,闯荡江湖,爱好交友,爱好打酱油,绝不放过一个坏人,也绝不漏过一个美女。欢迎折花送哥http://emuch.net/bbs/space.php?uid=1140333
4楼2011-05-21 00:14:19
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

smithjohn

金虫 (正式写手)

★ ★
小木虫(金币+0.5):给个红包,谢谢回帖
dubo(金币+1): 欢迎常来程序语言版讨论 2011-05-29 22:04:22
经常用tic/toc,cputime还是头一次听说啊
6楼2011-05-29 17:06:20
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
普通表情 高级回复(可上传附件)
信息提示
请填处理意见