12 #ifndef SSTMAC_COMMON_TIMESTAMP_H_INCLUDED 13 #define SSTMAC_COMMON_TIMESTAMP_H_INCLUDED 39 scaled_time(int64_t value, int64_t scaling,
const char *caller,
109 static const std::string &
168 return (ticks_ == other.
ticks_);
172 return (ticks_ != other.
ticks_);
176 return (ticks_ < other.
ticks_);
180 return (ticks_ <= other.
ticks_);
184 return (ticks_ > other.
ticks_);
188 return (ticks_ >= other.
ticks_);
tick_t ticks_
The current time value of this container in ticks.
static tick_t tick_interval()
Get the tick interval in picoseconds.
timestamp & operator+=(const timestamp &other)
static double min_time()
Get the smallest (most negative) time value possible (in seconds).
timestamp operator*(const timestamp &t, double scaling)
static const std::string & tick_interval_string()
Get the tick interval in std::string form (for example, "1ps").
double sec() const
Return the current time in seconds.
static double tick_interval_sec()
void correct_round_off(const timestamp &now)
std::string to_printf_type(timestamp t)
timestamp & operator-=(const timestamp &other)
bool operator<(const timestamp &other) const
double nsec() const
Return the current time in nanoseconds.
std::ostream & operator<<(std::ostream &os, const event_loc_id &loc)
bool operator<=(const timestamp &other) const
bool operator!=(const timestamp &other) const
tick_t ticks() const
Get the number of ticks.
int64_t ticks_int64() const
Convert a tick type to int64_t.
static tick_t frequency()
Get the number of ticks per second (1e12/tick_interval()).
timestamp operator/(const timestamp &t, double scaling)
double usec() const
Return the current time in microseconds.
timestamp & operator*=(double scale)
static timestamp exact_nsec(int64_t nsec)
Get a time value corresponding exactly to the given number of nanoseconds.
A basic container for time (subject to future transplant).
static double max_time()
Get the largest time value possible (in seconds).
SUMI = Simulator unified messagine interface It is also the name for a solid ink in Japanese - i...
int64_t tick_t
The type that holds a timestamp.
timestamp operator-(const timestamp &a, const timestamp &b)
static timestamp exact_sec(int64_t sec)
Get a time value corresponding exactly to the given number of seconds.
void operator()(sstmac::timestamp &t, serializer &ser)
static timestamp scaled_time(int64_t value, int64_t scaling, const char *caller, const char *units)
Picoseconds between clock ticks.
double msec() const
Return the current time in milliseconds.
#define START_SERIALIZATION_NAMESPACE
static void init_stamps(tick_t tick_spacing)
static int64_t tick_interval_int64()
timestamp operator+(const timestamp &a, const timestamp &b)
bool operator>(const timestamp &other) const
#define END_SERIALIZATION_NAMESPACE
static timestamp exact_ticks(T val)
Get a time value with exactly the given number of ticks.
static timestamp exact_msec(int64_t msec)
Get a time value corresponding exactly to the given number of milliseconds.
bool operator==(const timestamp &other) const
Fast and exact comparison operations.
static timestamp exact_usec(int64_t usec)
Get a time value corresponding exactly to the given number of microseconds.
static timestamp exact_psec(int64_t psec)
Get a time value corresponding exactly to the given number of picoseconds.
double psec() const
Return the current time in picoseconds.
bool operator>=(const timestamp &other) const
timestamp & operator/=(double scale)