<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial,helvetica,sans-serif;font-size:10pt">Profiling is really intended to profile a complex set of operations <br>not a single statement, for that timeit() would be a better choice.<br><br>However in this case, it may be that the time is so low it simply <br>doesn't register. Have you already imported math for example? <br>In which case you are effectively profiling a single if statement...<br><div><br>&nbsp;<br></div>Alan Gauld<br>Author of the Learn To Program website<br><a rel="nofollow" target="_blank" href="http://www.alan-g.me.uk">http://www.alan-g.me.uk/<br></a><div><br></div><div style="font-family:arial, helvetica, sans-serif;font-size:10pt"><br><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><font face="Tahoma" size="2"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> tee chwee liong
 &lt;tcl76@hotmail.com&gt;<br><b><span style="font-weight: bold;">To:</span></b> alan.gauld@btinternet.com; tutor@python.org<br><b><span style="font-weight: bold;">Sent:</span></b> Thursday, 17 March, 2011 9:06:56<br><b><span style="font-weight: bold;">Subject:</span></b> RE: [Tutor] time taken to execute certain task<br></font><br>

<style><!--
.hmmessage P
{
margin:0px;padding:0px;}
body.hmmessage
{
font-size:10pt;font-family:Tahoma;}
--></style>


hi, <br>
&nbsp;<br>
i used profiler. but it gives 0 sec? is this expected? tq<br>
&nbsp;<br>
&gt;&gt;&gt; profile.run('import math')<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3 function calls in 0.000 CPU seconds<br>
&nbsp;&nbsp; Ordered by: standard name<br>
&nbsp;&nbsp; ncalls&nbsp; tottime&nbsp; percall&nbsp; cumtime&nbsp; percall filename:lineno(function)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&nbsp;&nbsp;&nbsp; 0.000&nbsp;&nbsp;&nbsp; 0.000&nbsp;&nbsp;&nbsp; 0.000&nbsp;&nbsp;&nbsp; 0.000 :0(setprofile)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&nbsp;&nbsp;&nbsp; 0.000&nbsp;&nbsp;&nbsp; 0.000&nbsp;&nbsp;&nbsp; 0.000&nbsp;&nbsp;&nbsp; 0.000 &lt;string&gt;:1(&lt;module&gt;)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&nbsp;&nbsp;&nbsp; 0.000&nbsp;&nbsp;&nbsp; 0.000&nbsp;&nbsp;&nbsp; 0.000&nbsp;&nbsp;&nbsp; 0.000 profile:0(import math)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp; 0.000&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0.000&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; profile:0(profiler)<br><br>                                               
</div></div>



</div></body></html>