CMS 3D CMS Logo

Public Member Functions | Public Attributes

PentiumTime::OneTick Struct Reference

#include <PentiumTimer.h>

List of all members.

Public Member Functions

 OneTick ()
 ~OneTick ()

Public Attributes

double one

Detailed Description

Definition at line 24 of file PentiumTimer.h.


Constructor & Destructor Documentation

PentiumTime::OneTick::OneTick ( )

Definition at line 11 of file PentiumTimer.cc.

References filterCSVwithJSON::copy, gather_cfg::cout, i, and LaserDQM_cfg::input.

                            {
#ifdef __APPLE__
  // FIXME: PentiumTime not supported on mac.
  abort(); 
#else
  std::string input; 
  {
    std::ifstream cpuinfo("/proc/cpuinfo");
    cpuinfo.unsetf( std::ios::skipws );
    std::istream_iterator<char> sbegin(cpuinfo),send;
    copy(sbegin,send,inserter(input,input.end()));
    cpuinfo.close();
  }
  size_t i = input.find("cpu MHz");
  if (i==std::string::npos) {
    std::cout << "/proc/cpuinfo does not contain cpu speed..." << std::endl;
    one = 1.;
    return;
  }
  i = input.find(":",i);  
  one = 1.e-6/atof(input.substr(i+1,input.find("/n",i)-i).c_str());
#endif
}
PentiumTime::OneTick::~OneTick ( )

Definition at line 9 of file PentiumTimer.cc.

{}

Member Data Documentation

Definition at line 28 of file PentiumTimer.h.

Referenced by PentiumTime::oneTick().