<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Nested Timing</title>
	<atom:link href="http://blogs.mathworks.com/loren/2009/01/06/nested-timing/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.mathworks.com/loren/2009/01/06/nested-timing/</link>
	<description>Loren Shure works on design of the MATLAB language at MathWorks. She writes here about once a week on MATLAB programming and related topics.</description>
	<lastBuildDate>Thu, 09 Feb 2012 04:19:21 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Roy</title>
		<link>http://blogs.mathworks.com/loren/2009/01/06/nested-timing/#comment-29956</link>
		<dc:creator>Roy</dc:creator>
		<pubDate>Tue, 13 Jan 2009 04:06:58 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2009/01/06/nested-timing/#comment-29956</guid>
		<description>for long operations I prefer the output in a datestr format and not just raw seconds. This is mostly for jobs that take more than an hour. This is my timing pattern: 
&lt;pre&gt;
t0=now; 
for i=1:1000
   % do some stuff
   fprintf(&#039;iter: %d time:%s\n&#039;,i,datestr(now-t0,13));
end
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>for long operations I prefer the output in a datestr format and not just raw seconds. This is mostly for jobs that take more than an hour. This is my timing pattern: </p>
<pre>
t0=now;
for i=1:1000
   % do some stuff
   fprintf('iter: %d time:%s\n',i,datestr(now-t0,13));
end
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gautam Vallabha</title>
		<link>http://blogs.mathworks.com/loren/2009/01/06/nested-timing/#comment-29948</link>
		<dc:creator>Gautam Vallabha</dc:creator>
		<pubDate>Wed, 07 Jan 2009 15:50:49 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2009/01/06/nested-timing/#comment-29948</guid>
		<description>We can now calculate the overhead of tic/toc using tic/toc :)

&lt;pre&gt;
function tictoc
t = tic;
for i=1:1e5
    t2 = tic;
    ignore=toc(t2); % suppress output
end
% convert to millisec
overhead = (toc(t)/1e5)*1e3 
&lt;/pre&gt;


The overhead value I get (on my 1.8 GHz dual core Intel) is 0.0124 milliseconds. Not bad!</description>
		<content:encoded><![CDATA[<p>We can now calculate the overhead of tic/toc using tic/toc :)</p>
<pre>
function tictoc
t = tic;
for i=1:1e5
    t2 = tic;
    ignore=toc(t2); % suppress output
end
% convert to millisec
overhead = (toc(t)/1e5)*1e3
</pre>
<p>The overhead value I get (on my 1.8 GHz dual core Intel) is 0.0124 milliseconds. Not bad!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

