Re: question on timing results

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




--- Remco Poelstra <remco@xxxxxxxxxxxxx> wrote:

> Globe Trotter wrote:
> > Hi,
> > 
> > This is strictly not an FC question, but I would like to time two (mine and
> the
> > naive) competing algorithms. My question is how do I do it accounting for
> CPU
> > utilization. Unless I misunderstood the documentation, clock() provides the
> > processor time and so the difference between clock() at the beginning of
> the
> > call to an algorithm and the end would provide me with the CPU time
> elapsed.
> > However, if for some reason the processor was running at 75% or whatever,
> my
> > reported time would be affected, and hence there would not really be a fair
> > comparison. Does anyone have any ideas/suggestions as to how I may settle
> this
> > issue?
> 
> The bash commando 'time' gives real, user and system time of a command. 
> see 'man time' for more information.
> Perhaps that could be usefull.
> 

Thanks, however the issue is that it gives results on the entire program, not
the algorithm part. Matthew Miller indicates that clock() approximately does
what I want, so I will just use that.

Many thanks and best wishes!


		
__________________________________ 
Discover Yahoo! 
Have fun online with music videos, cool games, IM and more. Check it out! 
http://discover.yahoo.com/online.html


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux