Loading [MathJax]/extensions/tex2jax.js
Go to the documentation of this file.
30 #include "boost/format.hpp"
80 for (
unsigned long i = 0; i <
m_cycles; ++i ) result += sin(
gauss() );
90 Chrono chrono( chronoSvc(),
name() +
": the first loop" );
91 debug() <<
"the result of the first loop is " << doSomething() <<
endmsg;
95 Chrono chrono(
name() +
": the second loop", chronoSvc() );
96 debug() <<
"the result of the second loop is " << doSomething() <<
endmsg;
100 Chrono chrono( &m_chrono1 );
101 debug() <<
"the result of the third loop is " << doSomething() <<
endmsg;
105 Chrono chrono( m_chrono2 );
106 debug() <<
"the result of the fourth loop is " << doSomething() <<
endmsg;
111 debug() <<
"the result of the 5th loop is " << doSomething() <<
endmsg;
116 chronoSvc()->chronoStart(
name() +
": the 5th loop" );
117 debug() <<
"the result of the 5th loop is " << doSomething() <<
endmsg;
118 chronoSvc()->chronoStop(
name() +
": the 5th loop" );
128 const std::string format =
"| %1$-6d| %2$-12.5g| %3$12.5g+-%4$-12.5g|%6$12.5g/%7$-12.5g|";
129 const std::string header =
"| |%1$=7.7s|%2$=13.13s|%3$13.13s+-%4$-12.12s|%6$12.12g/%7$-12.12s|";
131 using namespace boost::io;
133 hdr.exceptions( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) );
135 hdr %
"#" %
"Total" %
"Mean" %
"RMS" %
"ErrMean" %
"Min" %
"Max";
137 always() <<
"The timing is (in us)" <<
std::endl
SmartIF< IRndmGenSvc > & randSvc() const
The standard RandomGen service, Return a pointer to the service if present.
Alias for backward compatibility.
double doSomething()
do something CPU-intensive
Parameters for the Gauss random number generation.
Random number accessor This small class encapsulates the use of the random number generator.
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
StatusCode finalize() override
the default (empty) implementation of IStateful::finalize() method
constexpr static const auto SUCCESS
StatusCode finalize() override
the finalization of the algorithm
#define DECLARE_COMPONENT(type)
Gaudi::Property< unsigned long > m_cycles
the length of the internal loops (property)
StatusCode execute() override
the execution of the algorithm
Algorithm(std::string name, ISvcLocator *svcloc, std::string version=PACKAGE_VERSION)
Constructor.