<?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: Timing Macros</title>
	<atom:link href="http://www.dailydoseofexcel.com/archives/2004/06/28/timing-macros/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dailydoseofexcel.com/archives/2004/06/28/timing-macros/</link>
	<description>Daily posts of Excel tips…and other stuff</description>
	<lastBuildDate>Tue, 07 Feb 2012 23:32:04 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Jamie Collins</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/06/28/timing-macros/#comment-1871</link>
		<dc:creator>Jamie Collins</dc:creator>
		<pubDate>Thu, 01 Jul 2004 14:03:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=660#comment-1871</guid>
		<description>&lt;p&gt;&lt;i&gt; &quot;MSKB 172338 has a good voerview of Operating System timers&quot;&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;I discovered wrong! According to the article, GetTickCount and TimeGetTime are the same resolution (10 milliseconds). So I choose GetTickCount because it has a nicer... I mean, more meaningful name.&lt;/p&gt;
&lt;p&gt;Jamie.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p><i> &#8220;MSKB 172338 has a good voerview of Operating System timers&#8221;</i></p>
<p>I discovered wrong! According to the article, GetTickCount and TimeGetTime are the same resolution (10 milliseconds). So I choose GetTickCount because it has a nicer&#8230; I mean, more meaningful name.</p>
<p>Jamie.</p>
<p></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob van Gelder</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/06/28/timing-macros/#comment-1870</link>
		<dc:creator>Rob van Gelder</dc:creator>
		<pubDate>Wed, 30 Jun 2004 08:04:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=660#comment-1870</guid>
		<description>&lt;p&gt;MSKB 172338 has a good voerview of Operating System timers&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://support.microsoft.com/default.aspx?scid=kb;en-us;172338&quot; rel=&quot;nofollow&quot;&gt;http://support.microsoft.com/default.aspx?scid=kb;en-us;172338&lt;/a&gt;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>MSKB 172338 has a good voerview of Operating System timers</p>
<p><a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;172338" rel="nofollow">http://support.microsoft.com/default.aspx?scid=kb;en-us;172338</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jamie Collins</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/06/28/timing-macros/#comment-1869</link>
		<dc:creator>Jamie Collins</dc:creator>
		<pubDate>Tue, 29 Jun 2004 18:08:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=660#comment-1869</guid>
		<description>&lt;p&gt;I&#039;ve discovered TimeGetTime has a 1 millisecond resolution, whereas GetTickCount is &#039;only&#039; approx 10 ms.&lt;/p&gt;
&lt;p&gt;Jamie.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I&#8217;ve discovered TimeGetTime has a 1 millisecond resolution, whereas GetTickCount is &#8216;only&#8217; approx 10 ms.</p>
<p>Jamie.</p>
<p></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ross</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/06/28/timing-macros/#comment-1868</link>
		<dc:creator>ross</dc:creator>
		<pubDate>Tue, 29 Jun 2004 11:38:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=660#comment-1868</guid>
		<description>&lt;p&gt;But which is the best gents???&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>But which is the best gents???</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jamie Collins</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/06/28/timing-macros/#comment-1867</link>
		<dc:creator>Jamie Collins</dc:creator>
		<pubDate>Tue, 29 Jun 2004 11:31:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=660#comment-1867</guid>
		<description>&lt;p&gt;I use GetTickCount, the simplest of Win32 APIs and probably the first one I knowingly used. It returns milliseconds elapsed since Windows was started:&lt;/p&gt;
&lt;p&gt;Option Explicit&lt;/p&gt;
&lt;p&gt;Private Declare Function GetTickCount _&lt;br&gt;
    Lib &quot;kernel32? () As Long&lt;/p&gt;
&lt;p&gt;Sub test1()&lt;/p&gt;
&lt;p&gt;Dim lngStart As Long&lt;br&gt;
Dim lngDuration As Long&lt;/p&gt;
&lt;p&gt;lngStart = GetTickCount&lt;/p&gt;
&lt;p&gt;&#039; &lt;/p&gt;
&lt;p&gt;lngDuration = GetTickCount - lngStart&lt;/p&gt;
&lt;p&gt;MsgBox Format(lngDuration / 24 / 60 / 60 / 1000, _&lt;br&gt;
    &quot;hh:nn:ss&quot;)&lt;/p&gt;
&lt;p&gt;End Sub&lt;/p&gt;
&lt;p&gt;Jamie.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I use GetTickCount, the simplest of Win32 APIs and probably the first one I knowingly used. It returns milliseconds elapsed since Windows was started:</p>
<p>Option Explicit</p>
<p>Private Declare Function GetTickCount _<br />
    Lib &#8220;kernel32? () As Long</p>
<p>Sub test1()</p>
<p>Dim lngStart As Long<br />
Dim lngDuration As Long</p>
<p>lngStart = GetTickCount</p>
<p>&#8216; </p>
<p>lngDuration = GetTickCount &#8211; lngStart</p>
<p>MsgBox Format(lngDuration / 24 / 60 / 60 / 1000, _<br />
    &#8220;hh:nn:ss&#8221;)</p>
<p>End Sub</p>
<p>Jamie.</p>
<p></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob van Gelder</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/06/28/timing-macros/#comment-1866</link>
		<dc:creator>Rob van Gelder</dc:creator>
		<pubDate>Tue, 29 Jun 2004 09:42:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=660#comment-1866</guid>
		<description>&lt;p&gt;I use the Multimedia Timer for timing - Somewhere I read this a high resolution timer.&lt;/p&gt;
&lt;p&gt;Declare Function timeGetTime Lib &quot;winmm.dll&quot; () As Long&lt;/p&gt;
&lt;p&gt;Dim lngStart As Long&lt;/p&gt;
&lt;p&gt;Sub Start()&lt;br&gt;
    lngStart = timeGetTime()&lt;br&gt;
End Sub&lt;/p&gt;
&lt;p&gt;Function Finish()&lt;br&gt;
    Finish = timeGetTime() - lngStart&lt;br&gt;
End Function&lt;/p&gt;
&lt;p&gt;Sub test()&lt;br&gt;
    Dim i As Long, lngLastRow As Long, lngTemp As Long, rng As Range&lt;/p&gt;
&lt;p&gt;    With ActiveSheet&lt;/p&gt;
&lt;p&gt;        &#039;set up test data&lt;br&gt;
        For i = 1 To 10000: .Cells(i, 1).Value = i: Next&lt;/p&gt;
&lt;p&gt;        &#039;do the 3 speed tests&lt;br&gt;
        Start&lt;br&gt;
        For i = 1 To 10000&lt;br&gt;
            lngTemp = Range(&quot;A&quot; &amp; i).Value&lt;br&gt;
        Next&lt;br&gt;
        Debug.Print &quot;Test 1: &quot; &amp; Finish&lt;/p&gt;
&lt;p&gt;        Start&lt;br&gt;
        For i = 1 To 10000&lt;br&gt;
            lngTemp = .Cells(i, 1).Value&lt;br&gt;
        Next&lt;br&gt;
        Debug.Print &quot;Test 2: &quot; &amp; Finish&lt;/p&gt;
&lt;p&gt;        Start&lt;br&gt;
        Set rng = .Range(&quot;A1?)&lt;br&gt;
        For i = 0 To 10000 - 1&lt;br&gt;
            lngTemp = rng.Offset(i, 0).Value&lt;br&gt;
        Next&lt;br&gt;
        Debug.Print &quot;Test 3: &quot; &amp; Finish&lt;/p&gt;
&lt;p&gt;    End With&lt;/p&gt;
&lt;p&gt;End Sub&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I use the Multimedia Timer for timing &#8211; Somewhere I read this a high resolution timer.</p>
<p>Declare Function timeGetTime Lib &#8220;winmm.dll&#8221; () As Long</p>
<p>Dim lngStart As Long</p>
<p>Sub Start()<br />
    lngStart = timeGetTime()<br />
End Sub</p>
<p>Function Finish()<br />
    Finish = timeGetTime() &#8211; lngStart<br />
End Function</p>
<p>Sub test()<br />
    Dim i As Long, lngLastRow As Long, lngTemp As Long, rng As Range</p>
<p>    With ActiveSheet</p>
<p>        &#8216;set up test data<br />
        For i = 1 To 10000: .Cells(i, 1).Value = i: Next</p>
<p>        &#8216;do the 3 speed tests<br />
        Start<br />
        For i = 1 To 10000<br />
            lngTemp = Range(&#8220;A&#8221; &amp; i).Value<br />
        Next<br />
        Debug.Print &#8220;Test 1: &#8221; &amp; Finish</p>
<p>        Start<br />
        For i = 1 To 10000<br />
            lngTemp = .Cells(i, 1).Value<br />
        Next<br />
        Debug.Print &#8220;Test 2: &#8221; &amp; Finish</p>
<p>        Start<br />
        Set rng = .Range(&#8220;A1?)<br />
        For i = 0 To 10000 &#8211; 1<br />
            lngTemp = rng.Offset(i, 0).Value<br />
        Next<br />
        Debug.Print &#8220;Test 3: &#8221; &amp; Finish</p>
<p>    End With</p>
<p>End Sub</p>
]]></content:encoded>
	</item>
</channel>
</rss>

