开发者

How can I measure how long a function runs in Matlab?

开发者 https://www.devze.com 2022-12-27 01:01 出处:网络
I have a M开发者_如何学JAVAatlab program that is running longer than I\'d like it to.Is there built-in way to profile Matlab, similar to how time works in unix?There are three ways:

I have a M开发者_如何学JAVAatlab program that is running longer than I'd like it to. Is there built-in way to profile Matlab, similar to how time works in unix?


There are three ways:

  • Tic/toc
  • timeit, a fancier version of tic/toc
  • Profiler (Desktop->Profiler in the Matlab Window)

The profiler allows you to see how much time each line takes, and thus, it is the best way to find bottlenecks.

0

精彩评论

暂无评论...
验证码 换一张
取 消