From f800dbc034e7a70a613bab8cd9d147be4f6e88b6 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Tue, 10 Jan 2017 21:26:13 -0500 Subject: windows build --- entityx/help/Timer.cc | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 entityx/help/Timer.cc (limited to 'entityx/help/Timer.cc') diff --git a/entityx/help/Timer.cc b/entityx/help/Timer.cc new file mode 100644 index 0000000..43960a7 --- /dev/null +++ b/entityx/help/Timer.cc @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2013 Antony Woods + * All rights reserved. + * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. + * + * Author: Antony Woods + */ + +#include "entityx/help/Timer.h" + +namespace entityx { +namespace help { + +Timer::Timer() { + _start = std::chrono::system_clock::now(); +} + +Timer::~Timer() { +} + +void Timer::restart() { + _start = std::chrono::system_clock::now(); +} + +double Timer::elapsed() { + return std::chrono::duration(std::chrono::system_clock::now() - _start).count(); +} + +} // namespace help +} // namespace entityx -- cgit v1.2.3