{"id":243,"date":"2008-12-31T16:40:36","date_gmt":"2008-12-31T21:40:36","guid":{"rendered":"https:\/\/blogs.mathworks.com\/steve\/2008\/12\/31\/another-timeit-update\/"},"modified":"2019-10-28T09:50:40","modified_gmt":"2019-10-28T13:50:40","slug":"another-timeit-update","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/steve\/2008\/12\/31\/another-timeit-update\/","title":{"rendered":"Another <tt>timeit<\/tt> update"},"content":{"rendered":"<p>\r\nI just posted another <tt>timeit<\/tt> update to the MATLAB Central File Exchange. (See my <a href=\"https:\/\/blogs.mathworks.com\/steve\/2008\/02\/29\/timing-code-in-matlab\/\">original post<\/a> on <tt>timeit<\/tt> for a detailed explanation of its purpose and use.) The new version has a few improvements:\r\n<\/p>\r\n\r\n<ul>\r\n<li> Times very fast functions more accurately <\/li>\r\n<li> Warns you when the reported time might be affected by time-measurement overhead <\/li>\r\n<li> Takes less time to finish for functions that take more than a few seconds to run <\/li>\r\n<\/ul>\r\n\r\n<p>\r\nHere's an example of the new warning message:\r\n<\/p>\r\n\r\n<pre>\r\n>> timeit(@() sin(pi))\r\nWarning: The measured time for F may be inaccurate because it is close to the\r\nestimated time-measurement overhead (1.2e-006 seconds).  Try measuring something\r\nthat takes longer. \r\n> In timeit at 100\r\n\r\nans =\r\n\r\n  2.7797e-007\r\n<\/pre>","protected":false},"excerpt":{"rendered":"<p>\r\nI just posted another timeit update to the MATLAB Central File Exchange. (See my original post on timeit for a detailed explanation of its purpose and use.) The new version has a few... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/steve\/2008\/12\/31\/another-timeit-update\/\">read more >><\/a><\/p>","protected":false},"author":42,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[532,34,474],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/posts\/243"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/users\/42"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/comments?post=243"}],"version-history":[{"count":1,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/posts\/243\/revisions"}],"predecessor-version":[{"id":2640,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/posts\/243\/revisions\/2640"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/media?parent=243"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/categories?post=243"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/tags?post=243"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}