summaryrefslogtreecommitdiff
path: root/src/metric_time.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-05-24 17:38:46 +0100
committerCarl Hetherington <cth@carlh.net>2014-05-24 17:38:46 +0100
commit208f598e2af83fe7be465680806c79af3da825d3 (patch)
tree295a1c34e7f11a8c6f2a0aee0ab57036a55f809f /src/metric_time.h
parent7002892583b9e008a1bd3469c6db859292927286 (diff)
More tests and fix MetricTime.
Diffstat (limited to 'src/metric_time.h')
-rw-r--r--src/metric_time.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/metric_time.h b/src/metric_time.h
index 4cea7f7..226c0a1 100644
--- a/src/metric_time.h
+++ b/src/metric_time.h
@@ -25,11 +25,14 @@
namespace sub {
+/** @class MetricTime
+ * @brief A time held in milliseconds.
+ */
class MetricTime
{
public:
MetricTime ()
- : _milliseconds (0)
+ : _ms (0)
{}
MetricTime (int h, int m, int s, int ms);
@@ -40,12 +43,14 @@ public:
int milliseconds () const;
private:
+ void split (int& h, int& m, int& s, int& ms) const;
+
friend bool operator== (MetricTime const & a, MetricTime const & b);
friend bool operator> (MetricTime const & a, MetricTime const & b);
friend bool operator< (MetricTime const & a, MetricTime const & b);
friend std::ostream& operator<< (std::ostream&, MetricTime const & t);
- int64_t _milliseconds;
+ int64_t _ms;
};
bool operator== (MetricTime const & a, MetricTime const & b);