CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes
PentiumTime::OneTick Struct Reference

#include <PentiumTimer.h>

Public Member Functions

 OneTick ()
 
 ~OneTick ()
 

Public Attributes

double one
 

Detailed Description

Definition at line 38 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, input, and AlCaHLTBitMon_QueryRunRegistry::string.

11  {
12 #ifdef __APPLE__
13  // FIXME: PentiumTime not supported on mac.
14  abort();
15 #else
17  {
18  std::ifstream cpuinfo("/proc/cpuinfo");
19  cpuinfo.unsetf( std::ios::skipws );
20  std::istream_iterator<char> sbegin(cpuinfo),send;
21  copy(sbegin,send,inserter(input,input.end()));
22  cpuinfo.close();
23  }
24  size_t i = input.find("cpu MHz");
25  if (i==std::string::npos) {
26  std::cout << "/proc/cpuinfo does not contain cpu speed..." << std::endl;
27  one = 1.;
28  return;
29  }
30  i = input.find(":",i);
31  one = 1.e-6/atof(input.substr(i+1,input.find("/n",i)-i).c_str());
32 #endif
33 }
int i
Definition: DBlmapReader.cc:9
static std::string const input
Definition: EdmProvDump.cc:44
tuple cout
Definition: gather_cfg.py:121
PentiumTime::OneTick::~OneTick ( )

Definition at line 9 of file PentiumTimer.cc.

9 {}

Member Data Documentation

double PentiumTime::OneTick::one

Definition at line 42 of file PentiumTimer.h.

Referenced by runEdmFileComparison.EdmObject::label(), and PentiumTime::oneTick().