diff options
author | Adrian Kummerlaender | 2018-05-26 13:20:47 +0200 |
---|---|---|
committer | Adrian Kummerlaender | 2018-05-26 13:21:40 +0200 |
commit | 34052b51e00c939a35294d7085cadb5111484dd3 (patch) | |
tree | 03a5b1e350e47e2aa8551393ef67b2124ad50ddb /src/timer.cc | |
parent | f728e4c8d202de241673a13ce61570b6acb4bba7 (diff) | |
download | computicle-34052b51e00c939a35294d7085cadb5111484dd3.tar computicle-34052b51e00c939a35294d7085cadb5111484dd3.tar.gz computicle-34052b51e00c939a35294d7085cadb5111484dd3.tar.bz2 computicle-34052b51e00c939a35294d7085cadb5111484dd3.tar.lz computicle-34052b51e00c939a35294d7085cadb5111484dd3.tar.xz computicle-34052b51e00c939a35294d7085cadb5111484dd3.tar.zst computicle-34052b51e00c939a35294d7085cadb5111484dd3.zip |
Separate headers into compilation units
Diffstat (limited to 'src/timer.cc')
-rw-r--r-- | src/timer.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/timer.cc b/src/timer.cc new file mode 100644 index 0000000..c46017c --- /dev/null +++ b/src/timer.cc @@ -0,0 +1,16 @@ +#include "timer.h" + +namespace timer { + +std::chrono::time_point<std::chrono::high_resolution_clock> now() { + return std::chrono::high_resolution_clock::now(); +} + +double millisecondsSince( + std::chrono::time_point<std::chrono::high_resolution_clock>& pit) { + return std::chrono::duration_cast<std::chrono::milliseconds>( + now() - pit + ).count(); +} + +} |