24小时热门版块排行榜    

CyRhmU.jpeg
查看: 1628  |  回复: 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的回帖

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的回帖

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的回帖

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的回帖

dubo(金币+1): 欢迎常来程序语言版讨论 2011-05-29 22:04:12
嗯。。。。
5楼2011-05-21 01:00:35
已阅   回复此楼   关注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的回帖

ppc

至尊木虫 (正式写手)

我是想比较单核与多核并行的差异
不知道哪个更合适一些
7楼2011-06-17 12:42:08
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

libralibra

至尊木虫 (著名写手)

骠骑将军

引用回帖:
Originally posted by ppc at 2011-06-17 12:42:08:
我是想比较单核与多核并行的差异
不知道哪个更合适一些

串并行比较我做过,如果规模较大,tic/toc满足要求了
matlab/VB/python/c++/Java写程序请发QQ邮件:790404545@qq.com
8楼2011-06-17 15:17:29
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

onlymindyou

铁杆木虫 (著名写手)


小木虫: 金币+0.5, 给个红包,谢谢回帖
请问,同一个程序,同一台电脑,运行状态不一样,用tic看的时间也不一样啊,这怎么对比?

比如,电脑打开10个程序,和电脑打开5个程序,显然用tic看出来的时间不一样啊
9楼2016-03-03 10:29:34
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

x_109178

木虫 (正式写手)


小木虫: 金币+0.5, 给个红包,谢谢回帖
CPUtime  是matlab自启动后所占用cpu的运行时间,

发自小木虫Android客户端
10楼2016-03-03 14:21:42
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 ppc 的主题更新
普通表情 高级回复(可上传附件)
信息提示
请填处理意见