24小时热门版块排行榜    

查看: 2026  |  回复: 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的回帖

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的回帖
查看全部 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的回帖

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

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的回帖
普通表情 高级回复 (可上传附件)
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 求调剂 +3 yunziaaaaa 2026-03-01 3/150 2026-03-01 21:45 by 王兆江
[考研] 26考研报考西工大材料308分求调剂 +3 weizhong123 2026-03-01 3/150 2026-03-01 21:42 by 公瑾逍遥
[考研] 272求调剂 +6 田智友 2026-02-28 6/300 2026-03-01 21:40 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 无际的草原
[考研] 272求调剂 +6 材紫有化 2026-02-28 6/300 2026-03-01 18:58 by 18137688336
[考研] 材料学调剂 +9 提神豆沙包 2026-02-28 11/550 2026-03-01 18:15 by ms629
[考研] 化工专硕348,一志愿985求调剂 +5 弗格个 2026-02-28 8/400 2026-03-01 17:25 by sunny81
[考研] 281求调剂 +4 2026计算机_诚心 2026-03-01 7/350 2026-03-01 17:20 by 2026计算机_诚心
[考研] 0856调剂 +4 刘梦微 2026-02-28 4/200 2026-03-01 15:35 by 吸一口猫气
[考研] 307求调剂 +5 wyyyqx 2026-03-01 5/250 2026-03-01 15:21 by Fff-1
[考研] 材料工程274求调剂 +3 Lilithan 2026-03-01 3/150 2026-03-01 14:58 by ms629
[考研] 303求调剂 +4 今夏不夏 2026-03-01 4/200 2026-03-01 14:46 by 嘟嘟小浣熊
[考研] 求调剂 +6 repeatt?t 2026-02-28 6/300 2026-03-01 14:37 by Sakura绘
[考研] 295复试调剂 +3 简木ChuFront 2026-03-01 3/150 2026-03-01 14:27 by zzxw520th
[考研] 284求调剂 +6 天下熯 2026-02-28 6/300 2026-03-01 14:19 by Ducount.Y
[考研] 调剂 +3 简木ChuFront 2026-02-28 3/150 2026-03-01 11:46 by 王伟要上岸啊
[考研] 317一志愿华南理工电气工程求调剂 +6 Soliloquy_Q 2026-02-28 11/550 2026-03-01 11:14 by 歌liekkas
[论文投稿] 求助coordination chemistry reviews 的写作模板 10+3 ljplijiapeng 2026-02-27 4/200 2026-03-01 09:07 by babero
[考研] 307求调剂 +4 73372112 2026-02-28 6/300 2026-03-01 00:04 by ll247
信息提示
请填处理意见