Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
Utilities
Timing
src
PentiumTimer.cc
Go to the documentation of this file.
1
#include "
Utilities/Timing/interface/PentiumTimer.h
"
2
#include <iostream>
3
#include <fstream>
4
#include <string>
5
#include <algorithm>
6
#include <iterator>
7
8
9
PentiumTime::OneTick::~OneTick
(){}
10
11
PentiumTime::OneTick::OneTick
() {
12
#ifdef __APPLE__
13
// FIXME: PentiumTime not supported on mac.
14
abort();
15
#else
16
std::string
input
;
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
}
i
int i
Definition:
DBlmapReader.cc:9
PentiumTime::OneTick::OneTick
OneTick()
Definition:
PentiumTimer.cc:11
PentiumTime::OneTick::~OneTick
~OneTick()
Definition:
PentiumTimer.cc:9
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:255
input
static std::string const input
Definition:
EdmProvDump.cc:44
PentiumTimer.h
filterCSVwithJSON.copy
tuple copy
Definition:
filterCSVwithJSON.py:35
gather_cfg.cout
tuple cout
Definition:
gather_cfg.py:121
Generated for CMSSW Reference Manual by
1.8.5