Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^3: How to measure time for a particular code section?

by zentara (Archbishop)
on Nov 25, 2012 at 11:51 UTC ( #1005477=note: print w/ replies, xml ) Need Help??


in reply to Re^2: How to measure time for a particular code section?
in thread How to measure time for a particular code section?

I'm a bit confused

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.

See Lies, Damn Lies and Benchmarks and No More Meaningless Benchmarks! for example. You can google for more discussions on the deceptive nature of benchmarks yourself.


I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh


Comment on Re^3: How to measure time for a particular code section?
Re^4: How to measure time for a particular code section?
by abdullah.yildiz (Novice) on Nov 25, 2012 at 12:18 UTC
    Thank you for your suggestions.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1005477]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (3)
As of 2014-07-13 22:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (252 votes), past polls