diff options
author | Max Kellermann <max@duempel.org> | 2014-08-29 12:22:25 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-08-29 12:23:09 +0200 |
commit | 3ac1475262c2ef8f2a76aac371daac2d01bc2383 (patch) | |
tree | b450bfef194c2a63e360b6abf376b44e80c8c10b /src/Chrono.hxx | |
parent | ad64bab5b225028c65f341c6c44369ab5e636edf (diff) |
Chrono: add methods ToS(), RoundS()
Diffstat (limited to 'src/Chrono.hxx')
-rw-r--r-- | src/Chrono.hxx | 16 |
1 files changed, 16 insertions, 0 deletions
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(); } |