[ROOT] TStopwatch doesn't reset

From: Dave Casper (dcasper@uci.edu)
Date: Sat Jan 06 2001 - 23:49:27 MET


	Hi,

I'm not sure if this is a Windows-specific feature of Root or not, but I
cannot get TStopwatch to reset.

Neither the reset argument to the Start method nor the explicit ResetCpuTime
method cause the counter to reset.

Also it appears to be an undocumented (and probably unintended) feature that
all TStopwatch objects return the same values.  For instance, in the
following code fragment, both timers return identical values (which are
proportional to the number of iterations in the for loop):

	TStopwatch timer1;
	timer1.Start(kTRUE);
	for (Int_t i=0; i<1000000; i++) {}
	timer1.Stop();
	Double_t t1 = timer1.GetCPUTime();
	TStopwatch timer2;
	timer2.Start(kTRUE);
	timer2.Stop();
	Double_t t2 = timer2.GetCPUTime();
	std::cout << t1 << " " << t2 << std::endl;


Dave
dcasper@uci.edu



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:33 MET