Basic Image AlgorithmS Library
2.8.0
|
class TimeMeasure contains functions for timing real time and cpu time. More...
#include <Base/Debug/TimeMeasure.hh>
Public Member Functions | |
void | CloseTimerFile () |
double | GetCycleCount () const |
return number of cycles between all subsequent calls to Start() and Stop() since last call to Reset() More... | |
double | GetFreq () const |
returns the frequency in Hz based on real time (= fps) More... | |
double | GetIdleTime () const |
WIN32: return time that system spended in idle mode in msec cmenk Seems to be a bit useless. More... | |
double | GetKernelTime () const |
WIN32: return time that system spended in kernel mode in msec cmenk = Sum over all processes on all processors in kernel mode (!!!including the system idle process!!!) More... | |
double | GetRealTime () const |
return real time (=wall time clock) in usec JW For Win32: real-time is measured differently from user-/kernel-time. More... | |
double | GetUserFreq () const |
returns the frequency in Hz based on user time (= fps) More... | |
double | GetUserTime () const |
return user time (=system usage time) in msec JW For Win32: user-time is the sum over all processes on all processors in user-mode (not only the calling process!) More... | |
bool | IsRunning () const |
void | LogToFileAndReset (const std::string &comment) |
double | MeasureOverhead () |
returns the number of cycles between subsequent Start() and Stop() calls !! implies a Reset(); !!! More... | |
double | MeasureProcessorFrequency () |
measures the ProcessorFrequency in MHz More... | |
void | Print (std::ostream &os=std::cout) const |
void | PrintCycleCount (std::ostream &os=std::cout) const |
prints the number of cycles between subsequent calls to Start() and Stop() since last call to Reset() to os More... | |
void | PrintIdleTime (std::ostream &os=std::cout, const bool &verbose=true) const |
print the time that the system spended in idle mode More... | |
void | PrintKernelTime (std::ostream &os=std::cout, const bool &verbose=true) const |
print the time that the system spended in kernel mode (WIN32) More... | |
void | PrintRealTime (std::ostream &os=std::cout, const bool &verbose=true) const |
print the real time (=wall time clok) More... | |
void | PrintUserTime (std::ostream &os=std::cout, const bool &verbose=true) const |
print the user time (=system usage time) More... | |
void | ReadCycleCounter (unsigned int *hi, unsigned int *lo) |
void | Reset () |
void | SetTimerFile (const std::string &file) |
void | Start () |
void | Stop () |
TimeMeasure () | |
default constructor: More... | |
~TimeMeasure () | |
print the output when the desctructor is called ? More... | |
Static Public Member Functions | |
static std::string | GetCurrentTimeAsString () |
Obtains the current time and returns as string. More... | |
static std::string | GetDateAsString () |
Obtains the current date and returns as string. More... | |
static void | MSecondsToHumanReadable (const unsigned long &msIN, int &msecOUT, int &seconds, int &minutes, int &hours, int &days, int &weeks) |
converts a given amount of millisecs to human redable format More... | |
static std::ostream & | PrintMsecHumanReadable (const unsigned long msecIN, std::ostream &os=std::cout) |
display nr of msecs in format weeks,days,hours,minutes,seconds More... | |
Protected Attributes | |
double | _dSum |
timeval | rtActual |
timeval | rtKernelSum |
timeval | rtLast |
timeval | rtRealSum |
bool | running |
struct tms startstruct | stopstruct |
clock_t | user |
Static Protected Attributes | |
static std::ofstream | TimerStream_ |
class TimeMeasure contains functions for timing real time and cpu time.
added Win32 rdtsc assembler cycle count with int64 jw 12/2004 added Linux cycle count functions for i386-processors woelk 07/2003
For Win32 the minimum requiered version is 0x0501 (WinXP/Server2005)
Definition at line 111 of file TimeMeasure.hh.
TimeMeasure::TimeMeasure | ( | ) |
default constructor:
Definition at line 16 of file TimeMeasure.cpp.
|
inline |
print the output when the desctructor is called ?
Definition at line 118 of file TimeMeasure.hh.
void TimeMeasure::CloseTimerFile | ( | ) |
Definition at line 338 of file TimeMeasure.cpp.
|
static |
Obtains the current time and returns as string.
For alternative formats see: http://www.cplusplus.com/reference/clibrary/ctime/strftime/
Definition at line 211 of file TimeMeasure.cpp.
double TimeMeasure::GetCycleCount | ( | ) | const |
return number of cycles between all subsequent calls to Start() and Stop() since last call to Reset()
Definition at line 421 of file TimeMeasure.cpp.
Referenced by BIAS::TrackerBaseInterface< StorageType >::EvaluateResult_(), BIAS::TrackerBaseInterface< StorageType >::RejectX84_(), BIAS::TrackerBaseSimple< StorageType >::Track_(), BIAS::TrackerBaseWeighted1D< StorageType >::Track_(), and BIAS::TrackerBaseWeighted< StorageType >::Track_().
|
static |
Obtains the current date and returns as string.
For alternative formats see: http://www.cplusplus.com/reference/clibrary/ctime/strftime/
Definition at line 224 of file TimeMeasure.cpp.
double TimeMeasure::GetFreq | ( | ) | const |
returns the frequency in Hz based on real time (= fps)
Definition at line 405 of file TimeMeasure.cpp.
double TimeMeasure::GetIdleTime | ( | ) | const |
WIN32: return time that system spended in idle mode in msec cmenk Seems to be a bit useless.
Definition at line 396 of file TimeMeasure.cpp.
double TimeMeasure::GetKernelTime | ( | ) | const |
WIN32: return time that system spended in kernel mode in msec cmenk = Sum over all processes on all processors in kernel mode (!!!including the system idle process!!!)
Definition at line 387 of file TimeMeasure.cpp.
double TimeMeasure::GetRealTime | ( | ) | const |
return real time (=wall time clock) in usec JW For Win32: real-time is measured differently from user-/kernel-time.
Don't wonder about small inconsistancies!
Definition at line 370 of file TimeMeasure.cpp.
Referenced by BIAS::CornerDetectorGradient< StorageType, CalculationType >::_EnforceMinimumDistance(), BIAS::StructureTensor< InputStorageType, OutputStorageType >::CalcStructureTensor5x5(), BIAS::StructureTensor< InputStorageType, OutputStorageType >::CalcStructureTensor7x7(), BIAS::Condensation::CalculateBaseWeights_(), BIAS::Condensation::CalculateMean_(), BIAS::CornerDetectorGradient< StorageType, CalculationType >::Detect(), BIAS::GrabMasterThread::Entry(), BIAS::TrackerBaseInterface< StorageType >::EvaluateResult_(), BIAS::VideoSource_Disk_Bayer::GrabSingle(), BIAS::VideoSource_Disk::GrabSingle(), BIAS::Condensation::InitPrior(), BIAS::Condensation::PredictNewSamplePositions(), BIAS::Tracker< StorageType, CalculationType >::PreparePyramide(), BIAS::Condensation::Process(), BIAS::TrackerBaseInterface< StorageType >::RejectX84_(), BIAS::TrackerBaseInterface< StorageType >::Track(), BIAS::Tracker< StorageType, CalculationType >::Track(), BIAS::TrackerBaseSimple< StorageType >::Track_(), BIAS::TrackerBaseWeighted1D< StorageType >::Track_(), and BIAS::TrackerBaseWeighted< StorageType >::Track_().
double TimeMeasure::GetUserFreq | ( | ) | const |
returns the frequency in Hz based on user time (= fps)
Definition at line 410 of file TimeMeasure.cpp.
double TimeMeasure::GetUserTime | ( | ) | const |
return user time (=system usage time) in msec JW For Win32: user-time is the sum over all processes on all processors in user-mode (not only the calling process!)
Definition at line 376 of file TimeMeasure.cpp.
Referenced by BIAS::Render_().
bool TimeMeasure::IsRunning | ( | ) | const |
Definition at line 415 of file TimeMeasure.cpp.
void TimeMeasure::LogToFileAndReset | ( | const std::string & | comment | ) |
Definition at line 358 of file TimeMeasure.cpp.
double TimeMeasure::MeasureOverhead | ( | ) |
returns the number of cycles between subsequent Start() and Stop() calls !! implies a Reset(); !!!
Definition at line 239 of file TimeMeasure.cpp.
double TimeMeasure::MeasureProcessorFrequency | ( | ) |
measures the ProcessorFrequency in MHz
Definition at line 255 of file TimeMeasure.cpp.
|
static |
converts a given amount of millisecs to human redable format
extracts hours, minutes, seconds, msecs from amout of msecs (1/1000 sec).
msecIN | input parameter |
Definition at line 144 of file TimeMeasure.cpp.
void TimeMeasure::Print | ( | std::ostream & | os = std::cout | ) | const |
Definition at line 455 of file TimeMeasure.cpp.
Referenced by BIAS::TimeMeasurement::~TimeMeasurement().
void TimeMeasure::PrintCycleCount | ( | std::ostream & | os = std::cout | ) | const |
prints the number of cycles between subsequent calls to Start() and Stop() since last call to Reset() to os
Definition at line 330 of file TimeMeasure.cpp.
void TimeMeasure::PrintIdleTime | ( | std::ostream & | os = std::cout , |
const bool & | verbose = true |
||
) | const |
print the time that the system spended in idle mode
verbose | true for additionoutput in days hour sminutes seconds cmenk |
Definition at line 316 of file TimeMeasure.cpp.
void TimeMeasure::PrintKernelTime | ( | std::ostream & | os = std::cout , |
const bool & | verbose = true |
||
) | const |
print the time that the system spended in kernel mode (WIN32)
verbose | true for additionoutput in days hour sminutes seconds cmenk |
Definition at line 302 of file TimeMeasure.cpp.
|
static |
display nr of msecs in format weeks,days,hours,minutes,seconds
Definition at line 178 of file TimeMeasure.cpp.
void TimeMeasure::PrintRealTime | ( | std::ostream & | os = std::cout , |
const bool & | verbose = true |
||
) | const |
print the real time (=wall time clok)
verbose | true for additionoutput in days hour sminutes seconds Jan Woetzel |
Definition at line 273 of file TimeMeasure.cpp.
Referenced by BIAS::PMDWarp::Draw().
void TimeMeasure::PrintUserTime | ( | std::ostream & | os = std::cout , |
const bool & | verbose = true |
||
) | const |
print the user time (=system usage time)
verbose | true for additionoutput in days hour sminutes seconds Jan Woetzel |
Definition at line 287 of file TimeMeasure.cpp.
|
inline |
void TimeMeasure::Reset | ( | ) |
Definition at line 432 of file TimeMeasure.cpp.
Referenced by BIAS::CornerDetectorGradient< StorageType, CalculationType >::_EnforceMinimumDistance(), BIAS::MixtureOfGaussians< StorageType >::Apply(), BIAS::StructureTensor< InputStorageType, OutputStorageType >::CalcStructureTensor5x5(), BIAS::StructureTensor< InputStorageType, OutputStorageType >::CalcStructureTensor7x7(), BIAS::Condensation::CalculateBaseWeights_(), BIAS::ColorHarris::CreateSTColor(), BIAS::CornerDetectorGradient< StorageType, CalculationType >::Detect(), BIAS::PMDWarp::Draw(), BIAS::GrabMasterThread::Entry(), BIAS::IntegralHistogram::GenerateIntegralHistDiffBin(), BIAS::VideoSource_Disk_Bayer::GrabSingle(), BIAS::VideoSource_Disk::GrabSingle(), BIAS::Condensation::PredictNewSamplePositions(), BIAS::Tracker< StorageType, CalculationType >::PreparePyramide(), BIAS::Condensation::Process(), BIAS::Render_(), BIAS::TimeMeasurement::Start(), BIAS::Tracker< StorageType, CalculationType >::Track(), and BIAS::TrackerBaseSimple< StorageType >::Track_().
void TimeMeasure::SetTimerFile | ( | const std::string & | file | ) |
Definition at line 345 of file TimeMeasure.cpp.
|
inline |
Definition at line 294 of file TimeMeasure.hh.
References ReadCycleCounter(), rtLast, and running.
Referenced by BIAS::CornerDetectorGradient< StorageType, CalculationType >::_EnforceMinimumDistance(), BIAS::MixtureOfGaussians< StorageType >::Apply(), BIAS::StructureTensor< InputStorageType, OutputStorageType >::CalcStructureTensor5x5(), BIAS::StructureTensor< InputStorageType, OutputStorageType >::CalcStructureTensor7x7(), BIAS::Condensation::CalculateBaseWeights_(), BIAS::Condensation::CalculateMean_(), BIAS::CornerDetectorGradient< StorageType, CalculationType >::Detect(), BIAS::PMDWarp::Draw(), BIAS::GrabMasterThread::Entry(), BIAS::TrackerBaseInterface< StorageType >::EvaluateResult_(), BIAS::IntegralHistogram::GenerateIntegralHistDiffBin(), BIAS::GrabMasterThread::GrabMasterThread(), BIAS::VideoSource_Disk_Bayer::GrabSingle(), BIAS::VideoSource_Disk::GrabSingle(), BIAS::Condensation::InitPrior(), BIAS::Condensation::PredictNewSamplePositions(), BIAS::VideoSource_Disk::PreGrab(), BIAS::Tracker< StorageType, CalculationType >::PreparePyramide(), BIAS::Condensation::Process(), BIAS::TrackerBaseInterface< StorageType >::RejectX84_(), BIAS::Render_(), BIAS::TimeMeasurement::Start(), BIAS::TrackerBaseInterface< StorageType >::Track(), BIAS::Tracker< StorageType, CalculationType >::Track(), and BIAS::TrackerBaseSimple< StorageType >::Track_().
|
inline |
Definition at line 312 of file TimeMeasure.hh.
References _dSum, ReadCycleCounter(), rtActual, rtLast, rtRealSum, running, stopstruct, and user.
Referenced by BIAS::CornerDetectorGradient< StorageType, CalculationType >::_EnforceMinimumDistance(), BIAS::MixtureOfGaussians< StorageType >::Apply(), BIAS::StructureTensor< InputStorageType, OutputStorageType >::CalcStructureTensor5x5(), BIAS::StructureTensor< InputStorageType, OutputStorageType >::CalcStructureTensor7x7(), BIAS::Condensation::CalculateBaseWeights_(), BIAS::Condensation::CalculateMean_(), BIAS::CornerDetectorGradient< StorageType, CalculationType >::Detect(), BIAS::PMDWarp::Draw(), BIAS::GrabMasterThread::Entry(), BIAS::TrackerBaseInterface< StorageType >::EvaluateResult_(), BIAS::IntegralHistogram::GenerateIntegralHistDiffBin(), BIAS::VideoSource_Disk_Bayer::GrabSingle(), BIAS::VideoSource_Disk::GrabSingle(), BIAS::Condensation::InitPrior(), BIAS::Condensation::PredictNewSamplePositions(), BIAS::Tracker< StorageType, CalculationType >::PreparePyramide(), BIAS::Condensation::Process(), BIAS::TrackerBaseInterface< StorageType >::RejectX84_(), BIAS::Render_(), BIAS::TrackerBaseInterface< StorageType >::Track(), BIAS::Tracker< StorageType, CalculationType >::Track(), BIAS::TrackerBaseSimple< StorageType >::Track_(), BIAS::TrackerBaseWeighted1D< StorageType >::Track_(), BIAS::TrackerBaseWeighted< StorageType >::Track_(), and BIAS::TimeMeasurement::~TimeMeasurement().
|
protected |
Definition at line 273 of file TimeMeasure.hh.
Referenced by Stop().
|
protected |
Definition at line 259 of file TimeMeasure.hh.
Referenced by Stop().
|
protected |
Definition at line 260 of file TimeMeasure.hh.
|
protected |
Definition at line 258 of file TimeMeasure.hh.
|
protected |
Definition at line 257 of file TimeMeasure.hh.
Referenced by Stop().
|
protected |
Definition at line 263 of file TimeMeasure.hh.
|
protected |
Definition at line 262 of file TimeMeasure.hh.
Referenced by Stop().
|
staticprotected |
Definition at line 284 of file TimeMeasure.hh.
|
protected |
Definition at line 261 of file TimeMeasure.hh.
Referenced by Stop().