Why is datenummx(clock) faster than now()?
3 次查看(过去 30 天)
显示 更早的评论
Why is running datenummx(clock) 4x faster than the standard now() call? https://gist.github.com/4432190
0 个评论
采纳的回答
per isakson
2013-1-2
编辑:per isakson
2013-1-2
The function, now, has one executable line of code
t = datenum(clock);
the function, datenum, calls the function, datenummx, after having done error checking, etc.
That's why.
2 个评论
per isakson
2013-1-3
编辑:per isakson
2013-1-3
I often find it difficult to understand the rational behind various design decisions of The MathWorks (TMW). Since, TMW is successful in the money-making industry, I guess TMW knows what they are doing.
Regarding datenummx I guess it is possible to make a faster function (little error checking, one OS (Windows only), maybe "in-place".) Post a new question.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Model Predictive Control Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!