COIN-OR::LEMON - Graph Library

source: lemon-benchmark/tests/benchmark_tools.h @ 11:cf6519daa7fa

Last change on this file since 11:cf6519daa7fa was 11:cf6519daa7fa, checked in by Alpar Juttner <alpar@…>, 13 years ago

Refactoring and test instance in test logs

File size: 821 bytes
RevLine 
[10]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
[11]9extern std::string test_name;
10extern std::string instance_name;
[10]11
[11]12extern const std::string DATADIR_PATH;
13
14
15inline void logTime(const std::string &_instance_name,
16                    const std::string &subtest_name,
17                    const lemon::TimeStamp &time)
[10]18{
[11]19  std::cout << "*** " << test_name
20            << ' ' << _instance_name
21            << ' ' << subtest_name
22            << ' ' << std::setiosflags(std::ios::fixed) << std::setprecision(4)
[10]23            << time.realTime() << ' '
24            << time.realTime()/(time.userTime()+time.systemTime()) - 1.0
25            << std::endl;
26}
27
[11]28inline void logTime(const std::string &subtest_name,
29                    const lemon::TimeStamp &time)
30{
31  logTime(instance_name,subtest_name,time);
32}
33
[10]34#endif
Note: See TracBrowser for help on using the repository browser.