<?xml version="1.0" encoding="windows-1252"?>
<node id="1005477" title="Re^3: How to measure time for a particular code section?" created="2012-11-25 06:51:08" updated="2012-11-25 06:51:08">
<type id="11">
note</type>
<author id="131741">
zentara</author>
<data>
<field name="doctext">
&lt;i&gt; I'm a bit confused&lt;/i&gt;&lt;p&gt;
Using time to measure code execution is not going to be accurate everytime it is run. What if the load on the cpu is heavier during one test, say for example because a cron job is running, or whatever else is eating up cpu cycles. The only way to really measure code execution, is how many cpu cycles it takes to get the task done, the time taken is a function of many things going on in the computer, from random delays in hard drive access, other processes suddenly using up cpu cycles, and just plain randomness. The way to get a good benchmark, would be to run the test code a thousand times over the course of a day, and take the average time.
&lt;p&gt;
See [id://338521] and [id://588703] for example. You can google for more discussions on the deceptive nature of benchmarks yourself.

&lt;!-- Node text goes above. Div tags should contain sig only --&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-131741"&gt;
&lt;hr /&gt;
I'm not really a human, but I play one on earth.&lt;br&gt;
[id://630805] ................... &lt;a href=http://zentara.net/japh.html&gt; flash japh &lt;/a&gt;

&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
1005424</field>
<field name="parent_node">
1005427</field>
</data>
</node>
