From 31a87c26f076df24fa2ef5414f4b0c67c056e3d6 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Fri, 24 Apr 2015 04:08:08 +0000 Subject: [PATCH] move another unused time function into the one place it was used from (which will be removed) --- include/libtorrent/aux_/time.hpp | 2 -- src/kademlia/logging.cpp | 10 +++++++--- src/time.cpp | 7 ------- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/include/libtorrent/aux_/time.hpp b/include/libtorrent/aux_/time.hpp index e18cab11e..0ce881851 100644 --- a/include/libtorrent/aux_/time.hpp +++ b/include/libtorrent/aux_/time.hpp @@ -40,8 +40,6 @@ POSSIBILITY OF SUCH DAMAGE. namespace libtorrent { namespace aux { - std::string log_time(); - // returns the current time, as represented by time_point. The // resolution of this timer is about 100 ms. time_point const& time_now(); diff --git a/src/kademlia/logging.cpp b/src/kademlia/logging.cpp index 41f9686a3..8f47b9ddd 100644 --- a/src/kademlia/logging.cpp +++ b/src/kademlia/logging.cpp @@ -32,7 +32,6 @@ POSSIBILITY OF SUCH DAMAGE. #include "libtorrent/kademlia/logging.hpp" #include "libtorrent/time.hpp" -#include "libtorrent/aux_/time.hpp" namespace libtorrent { namespace dht { @@ -40,8 +39,13 @@ namespace libtorrent { namespace dht log_event::log_event(log& log) : log_(log) { - if (log_.enabled()) - log_ << libtorrent::aux::log_time() << " [" << log.id() << "] "; + if (!log_.enabled()) return; + + static const time_point start = clock_type::now(); + char ret[200]; + snprintf(ret, sizeof(ret), "%" PRId64 + , total_microseconds(clock_type::now() - start)); + log_ << ret << " [" << log.id() << "] "; } log_event::~log_event() diff --git a/src/time.cpp b/src/time.cpp index 2e25c7d98..1a3793f2c 100644 --- a/src/time.cpp +++ b/src/time.cpp @@ -50,12 +50,5 @@ namespace libtorrent { namespace aux time_point const& time_now() { return aux::g_current_time; } - std::string log_time() - { - static const time_point start = clock_type::now(); - char ret[200]; - snprintf(ret, sizeof(ret), "%" PRId64, total_microseconds(clock_type::now() - start)); - return ret; - } } }