diff options
author | Andy <drumsetmonkey@gmail.com> | 2017-01-19 09:21:12 -0500 |
---|---|---|
committer | Andy <drumsetmonkey@gmail.com> | 2017-01-19 09:21:12 -0500 |
commit | 213d9ccfbb4752d4c62d6b7e6b3f9172cdf1bccc (patch) | |
tree | 7872c6f30c8adf048a7863a33d837299c7fb0771 /entityx/help/Timer.cc | |
parent | 19a32074595a4a2797eaeb978f8bd302f736f6a6 (diff) | |
parent | 8452b199d28bea53bf2c5e3b3d604064000fc73d (diff) |
Limb animation actually works
Diffstat (limited to 'entityx/help/Timer.cc')
-rw-r--r-- | entityx/help/Timer.cc | 32 |
1 files changed, 32 insertions, 0 deletions
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 <antony@teamwoods.org> + * 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 <antony@teamwoods.org> + */ + +#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<double>(std::chrono::system_clock::now() - _start).count(); +} + +} // namespace help +} // namespace entityx |