<?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: Keeping Track of Elapsed Time in Python</title>
	<atom:link href="http://www.techarticles.zeromu.net/programming/keeping-track-of-elapsed-time-in-python/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.techarticles.zeromu.net/programming/keeping-track-of-elapsed-time-in-python/</link>
	<description>Solutions to problems that were in our way.</description>
	<lastBuildDate>Wed, 11 Aug 2010 19:07:31 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: ChinoBling</title>
		<link>http://www.techarticles.zeromu.net/programming/keeping-track-of-elapsed-time-in-python/comment-page-1/#comment-802</link>
		<dc:creator>ChinoBling</dc:creator>
		<pubDate>Tue, 09 Feb 2010 22:58:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.techarticles.zeromu.net/?p=32#comment-802</guid>
		<description>Great tip. Quick, Easy and it works.</description>
		<content:encoded><![CDATA[<p>Great tip. Quick, Easy and it works.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aditya</title>
		<link>http://www.techarticles.zeromu.net/programming/keeping-track-of-elapsed-time-in-python/comment-page-1/#comment-150</link>
		<dc:creator>Aditya</dc:creator>
		<pubDate>Sun, 16 Nov 2008 11:02:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.techarticles.zeromu.net/?p=32#comment-150</guid>
		<description>Thank You for your time!!</description>
		<content:encoded><![CDATA[<p>Thank You for your time!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jake D</title>
		<link>http://www.techarticles.zeromu.net/programming/keeping-track-of-elapsed-time-in-python/comment-page-1/#comment-145</link>
		<dc:creator>Jake D</dc:creator>
		<pubDate>Sun, 09 Nov 2008 14:20:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.techarticles.zeromu.net/?p=32#comment-145</guid>
		<description>I was wrong in telling you to use sleep()... I should have known that because that is what this article is about.

Don&#039;t use sleep, your first idea was correct.

You will have to forgive me, I am in a huge rush and I forget python syntax and loops at the moment, but here is some pseudo-code mixed with actual code:

&lt;code&gt;
 import time  
#   
 start = time.time()  
#   
# START YOUR LOOP HERE (there are different approaches to the loop that you could take, but here is a crude way)
#   while 1  (&lt; - you want the loop to go forever)
# 
#   
 end = time.time()  
#   
 elapsed= end - start  
#   
# Check to see if the time is up (units are already in seconds):
# if elapsed &gt;= 10
#      Then exit the loop and do what needs to be done
#
# END YOUR LOOP HERE
#
# Continue with your script
&lt;/code&gt;

(It looks like I may have accidentally deleted your first comment!!! Sorry!)</description>
		<content:encoded><![CDATA[<p>I was wrong in telling you to use sleep()&#8230; I should have known that because that is what this article is about.</p>
<p>Don&#8217;t use sleep, your first idea was correct.</p>
<p>You will have to forgive me, I am in a huge rush and I forget python syntax and loops at the moment, but here is some pseudo-code mixed with actual code:</p>
<p><code><br />
 import time<br />
#<br />
 start = time.time()<br />
#<br />
# START YOUR LOOP HERE (there are different approaches to the loop that you could take, but here is a crude way)<br />
#   while 1  (< - you want the loop to go forever)<br />
#<br />
#<br />
 end = time.time()<br />
#<br />
 elapsed= end - start<br />
#<br />
# Check to see if the time is up (units are already in seconds):<br />
# if elapsed >= 10<br />
#      Then exit the loop and do what needs to be done<br />
#<br />
# END YOUR LOOP HERE<br />
#<br />
# Continue with your script<br />
</code></p>
<p>(It looks like I may have accidentally deleted your first comment!!! Sorry!)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aditya</title>
		<link>http://www.techarticles.zeromu.net/programming/keeping-track-of-elapsed-time-in-python/comment-page-1/#comment-144</link>
		<dc:creator>Aditya</dc:creator>
		<pubDate>Sun, 09 Nov 2008 10:48:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.techarticles.zeromu.net/?p=32#comment-144</guid>
		<description>I used the time.sleep function in my code but i ran into a slight problem..i used time.sleep to execute some lines of code after 10 seconds.however i find that sometimes it takes less than 10 seconds to execute or more than 10 seconds.i used time.now to time when the lines of code were executed.I need as much precision n this time lapse as possible.is there a way to optimize time.sleep for precision?or another way for it to wait for a precise time before doing it what i want?your help has guided me in my script almost all the way.I would really appreciate a little help in this last piece!!
Thank You
With Best Regards</description>
		<content:encoded><![CDATA[<p>I used the time.sleep function in my code but i ran into a slight problem..i used time.sleep to execute some lines of code after 10 seconds.however i find that sometimes it takes less than 10 seconds to execute or more than 10 seconds.i used time.now to time when the lines of code were executed.I need as much precision n this time lapse as possible.is there a way to optimize time.sleep for precision?or another way for it to wait for a precise time before doing it what i want?your help has guided me in my script almost all the way.I would really appreciate a little help in this last piece!!<br />
Thank You<br />
With Best Regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aditya</title>
		<link>http://www.techarticles.zeromu.net/programming/keeping-track-of-elapsed-time-in-python/comment-page-1/#comment-142</link>
		<dc:creator>Aditya</dc:creator>
		<pubDate>Mon, 03 Nov 2008 16:32:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.techarticles.zeromu.net/?p=32#comment-142</guid>
		<description>Thank You!I appreciate the time you took to write the script for me
Cheers</description>
		<content:encoded><![CDATA[<p>Thank You!I appreciate the time you took to write the script for me<br />
Cheers</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jake D</title>
		<link>http://www.techarticles.zeromu.net/programming/keeping-track-of-elapsed-time-in-python/comment-page-1/#comment-141</link>
		<dc:creator>Jake D</dc:creator>
		<pubDate>Sun, 02 Nov 2008 02:49:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.techarticles.zeromu.net/?p=32#comment-141</guid>
		<description>My first thought would be to NOT use a continuous loop to check elapsed time, although it might depend on how many other things you are doing besides simply printing a statement.

The &lt;code&gt;time&lt;/code&gt; module has a function called &lt;code&gt;sleep&lt;/code&gt; which might be more efficient.  Here is an example of usage: http://snipplr.com/view/5763/python-sleep/ .  Read the blurb on &lt;code&gt;sleep&lt;/code&gt; from the source: http://www.python.org/doc/2.5.2/lib/module-time.html . 

So, your code might look like:
&lt;code&gt;
#import the time module
import time 

#sleep for 60 seconds
time.sleep(60)

#print a message
print &#039;Hello World!&#039;
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>My first thought would be to NOT use a continuous loop to check elapsed time, although it might depend on how many other things you are doing besides simply printing a statement.</p>
<p>The <code>time</code> module has a function called <code>sleep</code> which might be more efficient.  Here is an example of usage: <a href="http://snipplr.com/view/5763/python-sleep/" rel="nofollow">http://snipplr.com/view/5763/python-sleep/</a> .  Read the blurb on <code>sleep</code> from the source: <a href="http://www.python.org/doc/2.5.2/lib/module-time.html" rel="nofollow">http://www.python.org/doc/2.5.2/lib/module-time.html</a> . </p>
<p>So, your code might look like:<br />
<code><br />
#import the time module<br />
import time </p>
<p>#sleep for 60 seconds<br />
time.sleep(60)</p>
<p>#print a message<br />
print 'Hello World!'<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jake D</title>
		<link>http://www.techarticles.zeromu.net/programming/keeping-track-of-elapsed-time-in-python/comment-page-1/#comment-90</link>
		<dc:creator>Jake D</dc:creator>
		<pubDate>Tue, 07 Oct 2008 00:36:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.techarticles.zeromu.net/?p=32#comment-90</guid>
		<description>Glad this helped, thanks for the comment!</description>
		<content:encoded><![CDATA[<p>Glad this helped, thanks for the comment!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zach</title>
		<link>http://www.techarticles.zeromu.net/programming/keeping-track-of-elapsed-time-in-python/comment-page-1/#comment-37</link>
		<dc:creator>zach</dc:creator>
		<pubDate>Fri, 08 Aug 2008 18:07:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.techarticles.zeromu.net/?p=32#comment-37</guid>
		<description>I had exactly the same problem, only I think it also applies to the ftplib module...

Thank you so much!</description>
		<content:encoded><![CDATA[<p>I had exactly the same problem, only I think it also applies to the ftplib module&#8230;</p>
<p>Thank you so much!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
