Tools.h++ Class Reference

Table Of Contents
Return the current setting for the benchmark test duration. This should not be confused with function time() which
returns the actual test time.
virtual void
go();
Call this function to run the benchmark.
virtual void
idleLoop(unsigned long N);
This function can help to correct the benchmark for overhead. The default definition merely executes a "for()" loop N
times. See the example.
const char *
machine();
This function accesses the name of the machine which is passed into the benchmark object through parse().
virtual void
parse(int argc, char* argv[]);
This function allows an easy way to change the test duration, number of inner loops and machine description from the
command line:
Argument Type Description
argv[1] double Duration (sec.)
argv[2] unsigned long No. of inner loops
argv[3] const char* Machine
void
parse(const char *);
This is a non-virtual function which provides the same service as parse(int argc, char * argv[]), but is designed for
Windows users. It extracts tokens from the null-terminated command argument provided by Windows, then calls the
virtual parse for ANSI C command arguments.
virtual void
report(ostream&) const;
Calling this function provides an easy and convenient way of getting an overall summary of the results of a benchmark.
double
setDuration(double t);
Change the test duration to time t.
unsigned long
setInnerLoops(unsigned long N);
Change the number of "inner loop operations" to N.
virtual void
what(ostream&) const;
You can supply a specializing version of this virtual function that provides some detail of what is being benchmarked.
It is called by report() when generating a standard report.
void
where(ostream&) const;
This function will print information to the stream about the compiler and memory model that the code was compiled
under.
unsigned long
innerLoops() const;