From 23bab6783b8fb4401543941983c36c41cd24b4ef Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Wed, 19 Jan 2011 16:22:15 -0800 Subject: Time: Add setTick and getTick functions to the Time class. --- src/base/time.hh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/base/time.hh') diff --git a/src/base/time.hh b/src/base/time.hh index 2c54f2675..4fc3dd3ef 100644 --- a/src/base/time.hh +++ b/src/base/time.hh @@ -42,6 +42,8 @@ #include #include +#include "base/types.hh" + class Time { protected: @@ -99,6 +101,18 @@ class Time */ void set(time_t _sec, long _nsec) { sec(_sec); nsec(_nsec); } + /** + * Set the current time from a value measured in Ticks + * @param ticks Number of ticks to convert into a time. + */ + void setTick(Tick ticks); + + /** + * Get the current time from a value measured in Ticks + * @return Time value measured in Ticks. + */ + Tick getTick() const; + const Time & operator=(const Time &other) { -- cgit v1.2.3