/* vim: set tabstop=4:softtabstop=4:shiftwidth=4:noexpandtab */
/*
 * SSTT - Simplified Spatial Target Tracker
 *
 * (c) Copyrights 2007-2018 Hartmut Seichter
 */

#include "pw/core/timer.hpp"


namespace pw {

static timer global_timer;

timer::timer()
{
    reset();
}

timer::~timer()
{
}

void timer::reset()
{
    _start = std::chrono::high_resolution_clock::now();
}

double timer::elapsed( unsigned int scale ) const
{
    std::chrono::duration<double> elapsed_seconds = std::chrono::high_resolution_clock::now() - _start;
    return elapsed_seconds.count() * scale;
}

double timer::now( unsigned int scale )
{
	return global_timer.elapsed(scale);
}

}

