tests/benchmark_tools.h
author Alpar Juttner <alpar@cs.elte.hu>
Sun, 11 Dec 2011 07:33:29 +0100
changeset 10 d7ce0311ece2
child 11 cf6519daa7fa
permissions -rw-r--r--
Some common benchmarking tools added
     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