<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
<br><br><div><div id="SkyDrivePlaceholder"></div><hr id="stopSpelling">Date: Fri, 27 Jan 2012 17:35:39 -0800<br>Subject: Re: [Tutor] compile time calculator<br>From: marc.tompkins@gmail.com<br>To: suryak@live.com<br>CC: tutor@python.org<br><br><div class="ecxgmail_quote">On Fri, Jan 27, 2012 at 7:46 AM, Surya K <span dir="ltr">&lt;<a href="mailto:suryak@live.com">suryak@live.com</a>&gt;</span> wrote:<br><blockquote class="ecxgmail_quote" style="border-left:1px #ccc solid;padding-left:1ex">



<div><div dir="ltr">
Hi,<div><br></div><div>I want to calculate compile time for my puzzles. </div></div></div></blockquote><br></div>Since nobody else has mentioned it yet...<br><a href="http://xkcd.com/303/" target="_blank">http://xkcd.com/303/</a><br></div><div><br></div><div><br></div><div>Well, using python documentation, I did this..</div><div><br></div><div>(calculating execution time).</div><div><br></div><div><div>def main():</div><div>## This is my whole puzzle code...</div><div><br></div><div><br></div><div>&nbsp; &nbsp; fobj_ip = open('D:/code/py/input.txt', 'r')</div><div>&nbsp; &nbsp; fobj_op = open('D:/code/py/output.txt','w')</div><div><br></div><div>&nbsp; &nbsp; line=1</div><div>&nbsp; &nbsp; for eachLine in fobj_ip:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; if line&gt;1:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fobj_op.write ("Case #%d: %d\n" %(line-1, the_count(eachLine) ) )</div><div>&nbsp; &nbsp; &nbsp; &nbsp; line+=1</div><div><br></div><div>&nbsp; &nbsp; pass</div><div><br></div><div>if __name__ == '__main__':</div><div>&nbsp; &nbsp; from timeit import Timer</div><div>&nbsp; &nbsp; main()</div><div>&nbsp; &nbsp; t = Timer("main()")</div><div>&nbsp; &nbsp; print t.timeit()</div></div><div><br></div><div><br></div><div>This is showing the following output</div><div><br></div><div><div>10000000 loops, best of 3: 0.0612 usec per loop</div></div><div><br></div><div>(This is repeating...)</div><div><br></div><div>So, what exactly is&nbsp;<span style="font-size: 10pt; ">0.0612 usec per loop, is that execution time of my whole program??</span></div><div>If, how do I calculate it in seconds.</div><div><br></div><div><br></div>                                               </div></body>
</html>