// Author: C. Loizides <mailto:loizides@ikf.uni-frankfurt.de>
//*-- Copyright © ALICE HLT Group
-#include "AliL3Stopwatch.h"
+#include "AliHLTStopwatch.h"
#ifdef no_root
-#include "AliL3StandardIncludes.h"
+#include "AliHLTStandardIncludes.h"
#if __GNUC__ == 3
using namespace std;
#endif
-/** \class AliL3Stopwatch
+/** \class AliHLTStopwatch
<pre>
//----------------------------------------------------
-// AliL3Stopwatch
+// AliHLTStopwatch
//
// Stopwatch class. This class returns the real and cpu time between
// the start and stop events (taken from Root)
*/
-ClassImp(AliL3Stopwatch)
+ClassImp(AliHLTStopwatch)
-clock_t AliL3Stopwatch::gTicks = 0;
+clock_t AliHLTStopwatch::gTicks = 0;
-AliL3Stopwatch::AliL3Stopwatch()
+AliHLTStopwatch::AliHLTStopwatch()
{
// Create a stopwatch and start it.
if (!gTicks) gTicks = (clock_t)sysconf(_SC_CLK_TCK);
Start();
}
-AliL3Stopwatch::~AliL3Stopwatch()
+AliHLTStopwatch::~AliHLTStopwatch()
{
}
-void AliL3Stopwatch::Start(Bool_t reset)
+void AliHLTStopwatch::Start(Bool_t reset)
{
// Start the stopwatch. If reset is kTRUE reset the stopwatch before
// starting it (including the stopwatch counter).
fCounter++;
}
-void AliL3Stopwatch::Stop()
+void AliHLTStopwatch::Stop()
{
// Stop the stopwatch.
fStopRealTime = GetRealTime();
fState = kStopped;
}
-void AliL3Stopwatch::Continue()
+void AliHLTStopwatch::Continue()
{
// Resume a stopped stopwatch. The stopwatch continues counting from the last
// Start() onwards (this is like the laptimer function).
if (fState == kUndefined){
- cerr << "Error in AliL3Stopwatch::Continue! Stopwatch not started." << endl;
+ cerr << "Error in AliHLTStopwatch::Continue! Stopwatch not started." << endl;
return;
}
fState = kRunning;
}
-Double_t AliL3Stopwatch::RealTime()
+Double_t AliHLTStopwatch::RealTime()
{
// Return the realtime passed between the start and stop events. If the
// stopwatch was still running stop it first.
if (fState == kUndefined){
- cerr << "Error in AliL3Stopwatch::RealTime! Stopwatch not started." << endl;
+ cerr << "Error in AliHLTStopwatch::RealTime! Stopwatch not started." << endl;
return -1.0;
}
return fTotalRealTime;
}
-Double_t AliL3Stopwatch::CpuTime()
+Double_t AliHLTStopwatch::CpuTime()
{
// Return the cputime passed between the start and stop events. If the
// stopwatch was still running stop it first.
if (fState == kUndefined){
- cerr << "Error in AliL3Stopwatch::CpuTime! Stopwatch not started." << endl;
+ cerr << "Error in AliHLTStopwatch::CpuTime! Stopwatch not started." << endl;
return -1.0;
}
if (fState == kRunning)
return fTotalCpuTime;
}
-Double_t AliL3Stopwatch::GetRealTime()
+Double_t AliHLTStopwatch::GetRealTime()
{
struct tms cpt;
Double_t trt = (Double_t)times(&cpt);
return trt / (Double_t)gTicks;
}
-Double_t AliL3Stopwatch::GetCPUTime()
+Double_t AliHLTStopwatch::GetCPUTime()
{
struct tms cpt;
times(&cpt);
}
//______________________________________________________________________________
-void AliL3Stopwatch::Print(Char_t *opt) const
+void AliHLTStopwatch::Print(Char_t *opt) const
{
// Print the real and cpu time passed between the start and stop events.
// and the number of times (slices) this TStopwatch was called
// (if this number > 1)
- Double_t realt = ((AliL3Stopwatch*)(this))->RealTime();
+ Double_t realt = ((AliHLTStopwatch*)(this))->RealTime();
Int_t hours = Int_t(realt / 3600);
realt -= hours * 3600;
Int_t sec = Int_t(realt);
Int_t counter = Counter();
if (counter <= 1 )
- printf("Real time %d:%d:%d, CP time %.3f", hours, min, sec, ((AliL3Stopwatch*)(this))->CpuTime());
+ printf("Real time %d:%d:%d, CP time %.3f", hours, min, sec, ((AliHLTStopwatch*)(this))->CpuTime());
else
- printf("Real time %d:%d:%d, CP time %.3f, %d slices", hours, min, sec, ((AliL3Stopwatch*)(this))->CpuTime(),counter);
+ printf("Real time %d:%d:%d, CP time %.3f, %d slices", hours, min, sec, ((AliHLTStopwatch*)(this))->CpuTime(),counter);
}
#endif