alpar@12: /* -*- mode: C++; indent-tabs-mode: nil; -*- alpar@12: * alpar@12: * This file is a part of LEMON, a generic C++ optimization library. alpar@12: * alpar@12: * Copyright (C) 2003-2011 alpar@12: * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport alpar@12: * (Egervary Research Group on Combinatorial Optimization, EGRES). alpar@12: * alpar@12: * Permission to use, modify and distribute this software is granted alpar@12: * provided that this copyright notice appears in all copies. For alpar@12: * precise terms see the accompanying LICENSE file. alpar@12: * alpar@12: * This software is provided "AS IS" with no warranty of any kind, alpar@12: * express or implied, and with no claim as to its suitability for any alpar@12: * purpose. alpar@12: * alpar@12: */ alpar@12: alpar@10: #ifndef BENCHMARK_TOOLS_H alpar@10: #define BENCHMARK_TOOLS_H alpar@10: alpar@10: #include alpar@10: #include alpar@10: #include alpar@10: #include alpar@10: alpar@11: extern std::string test_name; alpar@11: extern std::string instance_name; alpar@10: alpar@11: extern const std::string DATADIR_PATH; alpar@13: extern const std::string BENCHMARK_BUILD_ID; alpar@11: alpar@11: inline void logTime(const std::string &_instance_name, alpar@11: const std::string &subtest_name, alpar@11: const lemon::TimeStamp &time) alpar@10: { alpar@13: std::cout << "*** " << BENCHMARK_BUILD_ID alpar@13: << ' ' << test_name alpar@11: << ' ' << _instance_name alpar@11: << ' ' << subtest_name alpar@11: << ' ' << std::setiosflags(std::ios::fixed) << std::setprecision(4) alpar@10: << time.realTime() << ' ' alpar@10: << time.realTime()/(time.userTime()+time.systemTime()) - 1.0 alpar@10: << std::endl; alpar@10: } alpar@10: alpar@11: inline void logTime(const std::string &subtest_name, alpar@11: const lemon::TimeStamp &time) alpar@11: { alpar@11: logTime(instance_name,subtest_name,time); alpar@11: } alpar@11: alpar@10: #endif