From 3ac1475262c2ef8f2a76aac371daac2d01bc2383 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 29 Aug 2014 12:22:25 +0200 Subject: Chrono: add methods ToS(), RoundS() --- src/Chrono.hxx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/Chrono.hxx') diff --git a/src/Chrono.hxx b/src/Chrono.hxx index db7605726..e72975ea8 100644 --- a/src/Chrono.hxx +++ b/src/Chrono.hxx @@ -58,6 +58,14 @@ public: return SongTime(ms); } + constexpr rep ToS() const { + return count() / rep(1000); + } + + constexpr rep RoundS() const { + return (count() + 500) / rep(1000); + } + constexpr rep ToMS() const { return count(); } @@ -129,6 +137,14 @@ public: return SignedSongTime(ms); } + constexpr rep ToS() const { + return count() / rep(1000); + } + + constexpr rep RoundS() const { + return (count() + 500) / rep(1000); + } + constexpr rep ToMS() const { return count(); } -- cgit v1.2.3