24小时热门版块排行榜    

查看: 2027  |  回复: 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的回帖
普通表情 高级回复 (可上传附件)
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[基金申请] 成果系统访问量大,请一小时后再尝试。---NSFC啥时候好哦,已经两天这样了 +3 NSFC2026我来了 2026-02-28 3/150 2026-03-01 21:41 by autumntian
[考研] 274求调剂 +3 cgyzqwn 2026-03-01 6/300 2026-03-01 21:24 by cgyzqwn
[考研] 0805总分292,求调剂 +7 幻想之殇 2026-03-01 7/350 2026-03-01 21:22 by 公瑾逍遥
[考研] 材料化工调剂 +10 今夏不夏 2026-03-01 11/550 2026-03-01 19:49 by 无懈可击111
[考研] 306分材料调剂 +4 chuanzhu川烛 2026-03-01 5/250 2026-03-01 19:48 by 无际的草原
[考研] 295求调剂 +7 19171856320 2026-02-28 7/350 2026-03-01 18:54 by 18137688336
[考研] 0857调剂 +3 一ll半 2026-02-28 3/150 2026-03-01 18:32 by 热情沙漠
[考研] 328求调剂 +3 aaadim 2026-03-01 5/250 2026-03-01 17:29 by njzyff
[考研] 化工专硕348,一志愿985求调剂 +5 弗格个 2026-02-28 8/400 2026-03-01 17:25 by sunny81
[考研] 0856材料求调剂 +4 麻辣鱿鱼 2026-02-28 4/200 2026-03-01 16:51 by caszguilin
[考研] 285求调剂 +8 满头大汗的学生 2026-02-28 8/400 2026-03-01 16:47 by caszguilin
[基金申请] 刚录用,没有期刊号,但是在线可看的论文可以放为代表作吗 10+3 arang1 2026-03-01 3/150 2026-03-01 16:43 by babero
[考研] 材料工程274求调剂 +3 Lilithan 2026-03-01 3/150 2026-03-01 14:58 by ms629
[考研] 295复试调剂 +3 简木ChuFront 2026-03-01 3/150 2026-03-01 14:27 by zzxw520th
[考研] 298求调剂 +9 人间唯你是清欢 2026-02-28 12/600 2026-03-01 14:23 by Ducount.Y
[考研] 284求调剂 +6 天下熯 2026-02-28 6/300 2026-03-01 14:19 by Ducount.Y
[考研] 302材料工程求调剂 +4 Doleres 2026-03-01 5/250 2026-03-01 11:52 by liqiongjy
[考研] 调剂 +3 简木ChuFront 2026-02-28 3/150 2026-03-01 11:46 by 王伟要上岸啊
[硕博家园] 2025届双非化工硕士毕业,申博 +3 更多的是 2026-02-27 4/200 2026-03-01 10:04 by ztg729
[考研] 307求调剂 +4 73372112 2026-02-28 6/300 2026-03-01 00:04 by ll247
信息提示
请填处理意见