Hello Ronald,

Monday, September 10, 2001, Yacketta, Ronald <[EMAIL PROTECTED]> wrote:
YR> I have the following benchmark line in my perl code
 
YR> my  $etime = timeit(1, \&get_errors);
YR> more code
YR> printf OFN "egrep\t: %s\n", timestr($etime);
 
YR> is there a way to manipulate the timestr output? The function it calls has
YR> 4 5 second delays within it, I would like the timestr output to no report
YR> those delay's. Is there a way to take $etime and subtract 20 seconds from
YR> it to get the "actual" time the function took - the delays?
Well... afaik, no.
but - what delays?
sub timestr does not call anything heavy, look into Benchmark.pm
although, you can use timediff or you can modify benchmark values by
yourself.

  DB<1> x$t
0  Benchmark=ARRAY(0x656060)
   0  0
   1  0.22
   2  0
   3  0
   4  0
   5  0
  DB<2> n
main::(t.pl:6): print "loops took:",timestr($t),"\n";
  DB<2> n
loops took: 0 wallclock secs ( 0.22 usr +  0.00 sys =  0.22 CPU)


Best wishes,
 Maxim                            mailto:[EMAIL PROTECTED]



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to