Stopwatch bug!

Andy Haas (root_news@yahoo.com)
Fri, 28 Aug 1998 19:36:05 -0700 (PDT)


I believe there's a bug in TStopwatch of the new release (2.00/11). At
least, they don't act like they used to and are documented to act.

The following macro demonstrates:

{

w = new TStopwatch();
for (int i = 0; i<10000000;i++) { }
w->Stop();
w->Print();

w->Start();
for (int i = 0; i<10000000;i++) { }
w->Stop();
w->Print();

w->Start();
for (int i = 0; i<10000000;i++) { }
w->Stop();
w->Print();

w->Start();
for (int i = 0; i<10000000;i++) { }
w->Stop();
w->Print();

}

The results are:

root [2] .x haas/bench.c
test : Real Time = 2.04 seconds Cpu Time = 2.04 seconds
test : Real Time = 4.09 seconds Cpu Time = 4.09 seconds
test : Real Time = 6.13 seconds Cpu Time = 6.13 seconds
test : Real Time = 8.16 seconds Cpu Time = 8.16 seconds

I believe that they used to reset after each "stop". Now they seem to
continue where they left off. TBenchmark exibits the same behavior now
(of course). I believe the fState variable is not functioning
correctly. It used to be a static set of variables and is now an
enumeration, which should work, but apparently doesn't.

Cheers,
Andy.

==
Andrew Haas - haas@yahoo.com
University of Washingon Physics
Glast - D0

_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com