#pragma once #include /** * A representation of time. */ class Time { public: /** * A representation of time. * * @param time_micros Time in microseconds */ explicit Time(uint64_t time_micros); /** * Updates the time to the current time. */ void update(); /** * Returns the difference between two points in time. * * @param prev_time A previous point in time */ Time diff(Time prev_time); /** * Returns the time in seconds. */ double secs(); /** * Returns the time in milliseconds. */ double millisecs(); /** * Returns the time in microseconds. */ uint64_t microsecs(); private: uint64_t _time_micros; }; /** * Returns a time object for the time since the program started. */ Time time_now();