Example #1
0
    static double measure_runtime_seconds(
        IBenchmarkCase*         benchmark,
        StopwatchType&          stopwatch)
    {
        stopwatch.start();
        benchmark->run();
        stopwatch.measure();

        return stopwatch.get_seconds();
    }
Example #2
0
    static double measure_runtime_ticks(
        IBenchmarkCase*         benchmark,
        StopwatchType&          stopwatch)
    {
        stopwatch.start();
        benchmark->run();
        stopwatch.measure();

        return static_cast<double>(stopwatch.get_ticks());
    }
Example #3
0
    static double measure_runtime_seconds(
        IBenchmarkCase*         benchmark,
        StopwatchType&          stopwatch,
        const size_t            iteration_count)
    {
        stopwatch.start();

        for (size_t i = 0; i < iteration_count; ++i)
            benchmark->run();

        stopwatch.measure();

        return stopwatch.get_seconds();
    }