Tools.h++ Class Reference

Table Of Contents
if((token = (*tokener)()).isNull())
{
delete tokener;
tokener = new RWCTokenizer(string);
token = (*tokener)();
}
re = RWCRegexp(token);
}
delete tokener;
}
Program output:
Testing string
"A multi-character string with lots of words in it to be parsed out and searched
for."
Borland C++ V4.0
Brute force string search:
Iterations: 35
Inner loop operations: 1000
Total operations: 35000
Elapsed (user) time: 4.596
Kilo-operations per second: 7.61532
Borland C++ V4.0
Rogue Wave search:
Iterations: 53
Inner loop operations: 1000
Total operations: 53000
Elapsed (user) time: 2.824
Kilo-operations per second: 18.7677
Public Constructors
RWBench(double duration = 5, unsigned long ILO=1000,
const char* machine = 0);
The parameter duration is the nominal amount of time that the benchmark should take in seconds. The virtual function
doLoop(unsigned long) will be called over and over again until at least this amount of time has elapsed. The parameter
ILO is the number of "inner loop operations" that should be performed. This parameter will be passed in as parameter
N to doLoop(N). Parameter machine is an optional null terminated string that should describe the test environment
(perhaps the hardware the benchmark is being run on ).
Public Member Functions
virtual void
doLoop(unsigned long N)=0;
A pure virtual function whose actual definition should be supplied by the specializing class. This function will be
repeatedly called until a time duration has elapsed. It should perform the operation to be benchmarked N times. See the
example.
double
duration() const;