15#include <boost/format.hpp>
51 for (
unsigned long i = 0; i <
m_cycles; ++i ) result += sin( gauss() );
85 const std::string
format =
"| %1$-6d| %2$-12.5g| %3$12.5g+-%4$-12.5g|%6$12.5g/%7$-12.5g|";
86 const std::string header =
"| |%1$=7.7s|%2$=13.13s|%3$13.13s+-%4$-12.12s|%6$12.12g/%7$-12.12s|";
88 using namespace boost::io;
89 boost::format hdr( header );
90 hdr.exceptions( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) );
92 hdr %
"#" %
"Total" %
"Mean" %
"RMS" %
"ErrMean" %
"Min" %
"Max";
94 always() <<
"The timing is (in us)" << std::endl
95 << hdr.str() << std::endl
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.
#define DECLARE_COMPONENT(type)
a small helper class for implementation of ChronoStatSvc service, It also could be used as some local...
A small utility class for chronometry of user codes.
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
MsgStream & always() const
shortcut for the method msgStream(MSG::ALWAYS)
Algorithm(std::string name, ISvcLocator *svcloc, std::string version=PACKAGE_VERSION)
Constructor.
StatusCode finalize() override
the default (empty) implementation of IStateful::finalize() method
SmartIF< IChronoStatSvc > & chronoSvc() const
The standard Chrono & Stat service, Return a pointer to the service if present.
SmartIF< IRndmGenSvc > & randSvc() const
The standard RandomGen service, Return a pointer to the service if present.
const std::string & name() const override
The identifying name of the algorithm object.
Implementation of property with value of concrete type.
The primitive class to illustrate the usage of IChronoSvc , ChronoEntity & Chrono objects.
double doSomething()
do something CPU-intensive
StatusCode execute() override
Gaudi::Property< unsigned long > m_cycles
the length of the internal loops (property)
StatusCode finalize() override
Parameters for the Gauss random number generation.
Random number accessor This small class encapsulates the use of the random number generator.
This class is used for returning status codes from appropriate routines.
constexpr static const auto SUCCESS