aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-08-28 06:42:00 +0200
committerMax Kellermann <max@duempel.org>2014-08-28 06:42:04 +0200
commit78f911ac1911e0ebdab3afd26683653d416c08f0 (patch)
treed58c11d2dc7db9ef62071130b38c3232f65df17e
parent0f2a7226fb36b3b04b1fa408882a8f0920081850 (diff)
downloadmpd-78f911ac1911e0ebdab3afd26683653d416c08f0.tar.gz
mpd-78f911ac1911e0ebdab3afd26683653d416c08f0.tar.xz
mpd-78f911ac1911e0ebdab3afd26683653d416c08f0.zip
Chrono: add methods IsZero(), IsPositive()
-rw-r--r--src/Chrono.hxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Chrono.hxx b/src/Chrono.hxx
index 4c9fafe58..f20edaf59 100644
--- a/src/Chrono.hxx
+++ b/src/Chrono.hxx
@@ -73,6 +73,14 @@ public:
constexpr double ToDoubleS() const {
return double(count()) / 1000.;
};
+
+ constexpr bool IsZero() const {
+ return count() == 0;
+ }
+
+ constexpr bool IsPositive() const {
+ return count() > 0;
+ }
};
#endif