tests/benchmark_tools.h
changeset 10 d7ce0311ece2
child 11 cf6519daa7fa
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/tests/benchmark_tools.h	Sun Dec 11 07:33:29 2011 +0100
     1.3 @@ -0,0 +1,21 @@
     1.4 +#ifndef BENCHMARK_TOOLS_H
     1.5 +#define BENCHMARK_TOOLS_H
     1.6 +
     1.7 +#include<string>
     1.8 +#include<iostream>
     1.9 +#include<iomanip>
    1.10 +#include<lemon/time_measure.h>
    1.11 +
    1.12 +extern const char test_name[];
    1.13 +
    1.14 +inline void logTime(const std::string &subtest_name, const
    1.15 +                    lemon::TimeStamp &time)
    1.16 +{
    1.17 +  std::cout << "*** " << test_name << ' ' << subtest_name << ' '
    1.18 +	    << std::setiosflags(std::ios::fixed) << std::setprecision(4)
    1.19 +	    << time.realTime() << ' '
    1.20 +            << time.realTime()/(time.userTime()+time.systemTime()) - 1.0
    1.21 +            << std::endl;
    1.22 +}
    1.23 +
    1.24 +#endif