#include <PixelTimeFormatter.h>
Public Member Functions | |
struct timeval | getImSecTime (void) |
struct tm * | getITime (void) |
PixelTimeFormatter (std::string source) | |
void | stopTimer (void) |
Static Public Member Functions | |
static std::string | getmSecTime (void) |
static std::string | getTime (void) |
Private Attributes | |
struct timeval | endTime_ |
std::string | origin_ |
struct timeval | startTime_ |
bool | verbose_ |
Definition at line 27 of file PixelTimeFormatter.h.
pos::PixelTimeFormatter::PixelTimeFormatter | ( | std::string | source | ) | [inline] |
Definition at line 32 of file PixelTimeFormatter.h.
References gather_cfg::cout, getImSecTime(), origin_, LaserTracksInput_cfi::source, startTime_, and USE_TIMER_.
{ if( !USE_TIMER_) return ; origin_ = source ; std::cout << "[PixelTimeFormatter::PixelTimeFormatter()]\t\t Time counter started for " << origin_ << std::endl ; startTime_ = getImSecTime() ; }
struct timeval pos::PixelTimeFormatter::getImSecTime | ( | void | ) | [inline, read] |
Definition at line 96 of file PixelTimeFormatter.h.
Referenced by PixelTimeFormatter(), and stopTimer().
{ struct timeval msecTime; gettimeofday(&msecTime, (struct timezone *)0) ; return msecTime ; }
struct tm* pos::PixelTimeFormatter::getITime | ( | void | ) | [inline, read] |
Definition at line 72 of file PixelTimeFormatter.h.
References cond::rpcobgas::time.
{ struct tm *thisTime; time_t aclock; time( &aclock ); thisTime = localtime( &aclock ); return thisTime ; }
static std::string pos::PixelTimeFormatter::getmSecTime | ( | void | ) | [inline, static] |
Definition at line 82 of file PixelTimeFormatter.h.
References AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by pos::PixelPortcardMap::writeXMLHeader(), pos::PixelLTCConfig::writeXMLHeader(), pos::PixelMaskAllPixels::writeXMLHeader(), pos::PixelTBMSettings::writeXMLHeader(), pos::PixelDelay25Calib::writeXMLHeader(), pos::PixelLowVoltageMap::writeXMLHeader(), pos::PixelTrimAllPixels::writeXMLHeader(), pos::PixelDACSettings::writeXMLHeader(), pos::PixelMaxVsf::writeXMLHeader(), pos::PixelTKFECConfig::writeXMLHeader(), pos::PixelDetectorConfig::writeXMLHeader(), pos::PixelTTCciConfig::writeXMLHeader(), pos::PixelCalibConfiguration::writeXMLHeader(), pos::PixelFECConfig::writeXMLHeader(), pos::PixelFEDCard::writeXMLHeader(), pos::PixelFEDConfig::writeXMLHeader(), pos::PixelNameTranslation::writeXMLHeader(), pos::PixelGlobalDelay25::writeXMLHeader(), and pos::PixelPortCardConfig::writeXMLHeader().
{ char theDate[20] ; struct timeval msecTime; gettimeofday(&msecTime, (struct timezone *)0) ; sprintf(theDate, "%d-%d", (unsigned int)msecTime.tv_sec, (unsigned int)msecTime.tv_usec ); return std::string(theDate) ; }
static std::string pos::PixelTimeFormatter::getTime | ( | void | ) | [inline, static] |
Definition at line 50 of file PixelTimeFormatter.h.
References AlCaHLTBitMon_QueryRunRegistry::string, and cond::rpcobgas::time.
{ char theDate[20] ; struct tm *thisTime; time_t aclock; std::string date ; time( &aclock ); thisTime = localtime( &aclock ); sprintf(theDate, "%d-%02d-%02d %02d:%02d:%02d", thisTime->tm_year+1900, thisTime->tm_mon+1, thisTime->tm_mday, thisTime->tm_hour, thisTime->tm_min, thisTime->tm_sec ); date = theDate ; //std::cout << "[PixelTimeFormatter::getTime()]\t\t\t\t Time: " << date << std::endl ; return date ; }
void pos::PixelTimeFormatter::stopTimer | ( | void | ) | [inline] |
Definition at line 40 of file PixelTimeFormatter.h.
References gather_cfg::cout, endTime_, getImSecTime(), origin_, dqm_diff::start, startTime_, and USE_TIMER_.
{ if( !USE_TIMER_ ) return ; endTime_ = getImSecTime() ; double start = startTime_.tv_sec + startTime_.tv_usec/1000000. ; double stop = endTime_.tv_sec + endTime_.tv_usec/1000000. ; std::cout << "[PixelTimeFormatter::stopTimer()]\t\t\t Elapsed time: " << stop-start << " seconds for " << origin_ << std::endl ; }
struct timeval pos::PixelTimeFormatter::endTime_ [private] |
Definition at line 140 of file PixelTimeFormatter.h.
Referenced by stopTimer().
std::string pos::PixelTimeFormatter::origin_ [private] |
Definition at line 141 of file PixelTimeFormatter.h.
Referenced by PixelTimeFormatter(), and stopTimer().
struct timeval pos::PixelTimeFormatter::startTime_ [private] |
Definition at line 139 of file PixelTimeFormatter.h.
Referenced by PixelTimeFormatter(), and stopTimer().
bool pos::PixelTimeFormatter::verbose_ [private] |
Definition at line 142 of file PixelTimeFormatter.h.