tests/benchmark_tools.h
changeset 10 d7ce0311ece2
child 11 cf6519daa7fa
equal deleted inserted replaced
-1:000000000000 0:4cc15714489f
       
     1 #ifndef BENCHMARK_TOOLS_H
       
     2 #define BENCHMARK_TOOLS_H
       
     3 
       
     4 #include<string>
       
     5 #include<iostream>
       
     6 #include<iomanip>
       
     7 #include<lemon/time_measure.h>
       
     8 
       
     9 extern const char test_name[];
       
    10 
       
    11 inline void logTime(const std::string &subtest_name, const
       
    12                     lemon::TimeStamp &time)
       
    13 {
       
    14   std::cout << "*** " << test_name << ' ' << subtest_name << ' '
       
    15 	    << std::setiosflags(std::ios::fixed) << std::setprecision(4)
       
    16 	    << time.realTime() << ' '
       
    17             << time.realTime()/(time.userTime()+time.systemTime()) - 1.0
       
    18             << std::endl;
       
    19 }
       
    20 
       
    21 #endif