<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Atomic Monks, LLC — Brother Erryn's VB Timer Alternatives]]></title>
		<link>http://forums.atomicmonks.com/topic/1054/brother-erryns-vb-timer-alternatives/</link>
		<atom:link href="http://forums.atomicmonks.com/feed/rss/topic/1054/" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Brother Erryn's VB Timer Alternatives.]]></description>
		<lastBuildDate>Thu, 31 Dec 2009 02:29:16 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Brother Erryn's VB Timer Alternatives]]></title>
			<link>http://forums.atomicmonks.com/post/6735/#p6735</link>
			<description><![CDATA[<p>Wow, that&#039;s been a while. I guess you&#039;re talking about my old articles on GPWiki (also posted here)? Those were written years ago, back in the days of .NET 1.0...today I would use something else. If you&#039;re wanting something to automatically fire at regular intervals, consider using the <a href="http://msdn.microsoft.com/en-us/library/system.windows.threading.dispatchertimer.aspx">DispatcherTimer</a> (.NET 3.0) class.</p><p>Here&#039;s an example of it in use:<br /></p><div class="codebox"><pre><code>timer.Interval = New TimeSpan(0, 0, 1)
timer.IsEnabled = True
AddHandler timer.Tick, AddressOf UpdateUI
timer.Start()</code></pre></div><p>If you just want to get an accurate measure of how much time has passed since the last time you checked, use the <a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.stopwatch.aspx">Stopwatch</a> (.NET 2.0) class.</p><p>An example of using the Stopwatch:<br /></p><div class="codebox"><pre><code>Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();

... do stuff ...

stopWatch.Stop();
// Get the elapsed time as a TimeSpan value.
TimeSpan ts = stopWatch.Elapsed;</code></pre></div><p>Does this sort of answer your question? You didn&#039;t really say anything about what you&#039;re trying to do with your timer in this case.</p>]]></description>
			<author><![CDATA[null@example.com (Brother Erryn)]]></author>
			<pubDate>Thu, 31 Dec 2009 02:29:16 +0000</pubDate>
			<guid>http://forums.atomicmonks.com/post/6735/#p6735</guid>
		</item>
		<item>
			<title><![CDATA[Brother Erryn's VB Timer Alternatives]]></title>
			<link>http://forums.atomicmonks.com/post/6734/#p6734</link>
			<description><![CDATA[<p>Hi, Brother Erryn!</p><p>I am JamRoll, an intermediate programmer in VB.&nbsp; I am creating a game of my own (no name...yet).&nbsp; I am currently using the clunky timer control provided by vb express 2008.&nbsp; I have viewed your posts regarding timers...but I am confused.&nbsp; I would have posted to yours posts, but it says I don&#039;t have permission to...</p><p>Currently I have</p><div class="codebox"><pre><code>    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs)  _
      Handles Timer1.Tick
          Invalidate()
    End Sub</code></pre></div><p>Um...how do I incorporate your method into my program???<br />Or am I just way off base here?&nbsp; LOL <img src="http://forums.atomicmonks.com/img/smilies/big_smile.png" width="15" height="15" alt="big_smile" /></p><p>Sincerely,</p><p>JamRoll</p>]]></description>
			<author><![CDATA[null@example.com (JamRoll)]]></author>
			<pubDate>Wed, 30 Dec 2009 23:41:22 +0000</pubDate>
			<guid>http://forums.atomicmonks.com/post/6734/#p6734</guid>
		</item>
	</channel>
</rss>

