From 089e60fa1ee45893b4c75240df25185ea835f243 Mon Sep 17 00:00:00 2001 From: Patrick Niklaus Date: Tue, 24 May 2016 22:23:08 +0200 Subject: [PATCH] Remove obsolete timer code --- include/util/timing_util.hpp | 41 ------------------------------------ 1 file changed, 41 deletions(-) diff --git a/include/util/timing_util.hpp b/include/util/timing_util.hpp index 537f0dc5e..c248559df 100644 --- a/include/util/timing_util.hpp +++ b/include/util/timing_util.hpp @@ -1,55 +1,14 @@ #ifndef TIMING_UTIL_HPP #define TIMING_UTIL_HPP -#include #include #include -#include -#include namespace osrm { namespace util { -struct GlobalTimer -{ - GlobalTimer() : time(0) {} - std::atomic time; -}; - -class GlobalTimerFactory -{ - public: - static GlobalTimerFactory &get() - { - static GlobalTimerFactory instance; - return instance; - } - - GlobalTimer &getGlobalTimer(const std::string &name) - { - std::lock_guard lock(map_mutex); - return timer_map[name]; - } - - private: - std::mutex map_mutex; - std::unordered_map timer_map; -}; - -#define GLOBAL_TIMER_AQUIRE(_X) \ - auto &_X##_global_timer = GlobalTimerFactory::get().getGlobalTimer(#_X) -#define GLOBAL_TIMER_RESET(_X) _X##_global_timer.time = 0 -#define GLOBAL_TIMER_START(_X) TIMER_START(_X) -#define GLOBAL_TIMER_STOP(_X) \ - TIMER_STOP(_X); \ - _X##_global_timer.time += TIMER_NSEC(_X) -#define GLOBAL_TIMER_NSEC(_X) static_cast(_X##_global_timer.time) -#define GLOBAL_TIMER_USEC(_X) (_X##_global_timer.time / 1000.0) -#define GLOBAL_TIMER_MSEC(_X) (_X##_global_timer.time / 1000.0 / 1000.0) -#define GLOBAL_TIMER_SEC(_X) (_X##_global_timer.time / 1000.0 / 1000.0 / 1000.0) - #define TIMER_START(_X) auto _X##_start = std::chrono::steady_clock::now(), _X##_stop = _X##_start #define TIMER_STOP(_X) _X##_stop = std::chrono::steady_clock::now() #define TIMER_NSEC(_X) \