Commit 3ac14752 authored by Max Kellermann's avatar Max Kellermann

Chrono: add methods ToS(), RoundS()

parent ad64bab5
...@@ -58,6 +58,14 @@ public: ...@@ -58,6 +58,14 @@ public:
return SongTime(ms); return SongTime(ms);
} }
constexpr rep ToS() const {
return count() / rep(1000);
}
constexpr rep RoundS() const {
return (count() + 500) / rep(1000);
}
constexpr rep ToMS() const { constexpr rep ToMS() const {
return count(); return count();
} }
...@@ -129,6 +137,14 @@ public: ...@@ -129,6 +137,14 @@ public:
return SignedSongTime(ms); return SignedSongTime(ms);
} }
constexpr rep ToS() const {
return count() / rep(1000);
}
constexpr rep RoundS() const {
return (count() + 500) / rep(1000);
}
constexpr rep ToMS() const { constexpr rep ToMS() const {
return count(); return count();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment