<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>theDeSilva.com&#187; timer functions</title>
	<atom:link href="http://www.thedesilva.com/tag/timer-functions/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thedesilva.com</link>
	<description>Andrew de Silva</description>
	<lastBuildDate>Tue, 26 Apr 2011 20:24:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>JavaScript Timers</title>
		<link>http://www.thedesilva.com/2009/08/javascript-timers/</link>
		<comments>http://www.thedesilva.com/2009/08/javascript-timers/#comments</comments>
		<pubDate>Thu, 06 Aug 2009 19:32:06 +0000</pubDate>
		<dc:creator>Andrew de Silva</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[cleartimeout method]]></category>
		<category><![CDATA[javascript timer]]></category>
		<category><![CDATA[setinterval method]]></category>
		<category><![CDATA[settimeout method]]></category>
		<category><![CDATA[timer functions]]></category>

		<guid isPermaLink="false">http://www.thedesilva.com/?p=149</guid>
		<description><![CDATA[<img src="http://www.thedesilva.com/img/category_icon//java-duke-logo-small.png" width="60" height="60" alt="" title="Javascript" /><br/>JavaScript provides setTimeout(), clearTimeout() , setInterval() and clearInterval() for your javascript timer functions which allows you to run a piece of Javascript code at some point in the future. Here are some explanation of the functions. setTimeout &#40; expression, timeout &#41;; setTimeout() returns a numeric timeout ID that can be used to track the timeout. [...]]]></description>
			<content:encoded><![CDATA[<img src="http://www.thedesilva.com/img/category_icon//java-duke-logo-small.png" width="60" height="60" alt="" title="Javascript" /><br/><p>JavaScript provides setTimeout(), clearTimeout() , setInterval() and clearInterval() for your javascript timer functions which allows you to run a piece of Javascript code at some point in the future. Here are some explanation of the functions.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">setTimeout <span style="color: #009900;">&#40;</span> expression<span style="color: #339933;">,</span> timeout <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>setTimeout() returns a numeric timeout ID that can be used to track the timeout. This is most commonly used with the clearTimeout() method</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">clearTimeout <span style="color: #009900;">&#40;</span> timeoutId <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">// where timeoutId is the ID of the timeout as returned from the setTimeout() method call.</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">setInterval <span style="color: #009900;">&#40;</span> expression<span style="color: #339933;">,</span> interval <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>setInterval() is really close to setTimeout() but setTimeout() only triggers the expression once while setInterval keep triggering the expression over and over.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">clearInterval<span style="color: #009900;">&#40;</span>timeoutId <span style="color: #009900;">&#41;</span>
<span style="color: #006600; font-style: italic;">// where timeoutId is the ID of the timeout as returned from the setInterval() method call.</span></pre></div></div>

<p>clearInterval() is used to cancel a setInterval() when you want to cancel a setInterval() then you need to call clearInterval(), passing in the interval ID returned by the call to setInterval().</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thedesilva.com/2009/08/javascript-timers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

