|
struct | blaze::timing::CpuPolicy |
| Timing policy for the measurement of the CPU time.The CpuPolicy class represents the timing policy for CPU time measurements that can be used in combination with the Timer class template. This combination is realized with the CpuTimer type definition. More...
|
|
class | blaze::timing::Timer< TP > |
| Progress timer for time and performance measurements.The Timer class offers timing & benchmarking functionality for all kinds of applications. The following example code demonstrates the use of the WcTimer class, which combines the Timer class template with the WcPolicy for wall clock time measurements, for a single time measurement: More...
|
|
struct | blaze::timing::WcPolicy |
| Timing policy for the measurement of the wall clock time.The WcPolicy class represents the timing policy for wall clock time measurements that can be used in combination with the Timer class template. This combination is realized with the WcTimer type definition. More...
|
|
|
using | blaze::timing::CpuTimer = Timer< CpuPolicy > |
| Progress timer for CPU time measurements.The CpuTimer combines the Timer class template with the CpuPolicy timing policy. It measures the amount of time the measured program or code fragment uses in processing central processing unit (CPU) instructions.
|
|
using | blaze::timing::WcTimer = Timer< WcPolicy > |
| Progress timer for wall clock time measurements.The WcTimer combines the Timer class template with the WcPolicy timing policy. It measures the amount of "wall clock" time elapsing for the processing of a programm or code fragment. In contrast to the measurement of CPU time, the wall clock time also contains waiting times such as input/output operations.
|
|
The timing submodule offers the necessary functionality for timing and benchmarking purposes. The central element of the timing module is the Timer class. Depending on a chosen timing policy, this class offers the possibility to measure both single times and time series. In order to make time measurement as easy as possible, the Blaze library offers the two classes WcTimer and CpuTimer (both using the Timer class) to measure both wall clock and CPU time. The following example gives an impression on how time measurement for a single time works with the the Blaze library. Note that in this example the WcTimer could be easily replaced with the CpuTimer if instead of the wall clock time the CPU time was to be measured.
...
timer.end();
double time = timer.last();
As already mentioned, it is also possible to start several time measurements with a single timer to evaluate for instance the minimal, the maximal or the average time of a specific task. The next example demonstrates a possible setup for such a series of time measurements:
...
for( unsigned int i=0; i<10; ++i ) {
timer.start();
...
timer.end();
}
double average = timer.average();