move another unused time function into the one place it was used from (which will be removed)

This commit is contained in:
Arvid Norberg 2015-04-24 04:08:08 +00:00
parent 3ea67e2bf5
commit 31a87c26f0
3 changed files with 7 additions and 12 deletions

View File

@ -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();

View File

@ -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()

View File

@ -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;
}
} }