![]() |
Spicy
|
#include <interval.h>
Classes | |
struct | NanosecondTag |
struct | SecondTag |
Public Member Functions | |
Interval (const hilti::rt::integer::safe< int64_t > &nsecs, NanosecondTag) | |
Interval (double secs, SecondTag) | |
Interval (const Interval &)=default | |
Interval (Interval &&) noexcept=default | |
Interval & | operator= (const Interval &)=default |
Interval & | operator= (Interval &&) noexcept=default |
double | seconds () const |
int64_t | nanoseconds () const |
bool | operator== (const Interval &other) const |
bool | operator!= (const Interval &other) const |
bool | operator< (const Interval &other) const |
bool | operator<= (const Interval &other) const |
bool | operator> (const Interval &other) const |
bool | operator>= (const Interval &other) const |
Interval | operator+ (const Interval &other) const |
Interval | operator- (const Interval &other) const |
Interval | operator* (const hilti::rt::integer::safe< std::int64_t > &i) const |
Interval | operator* (const hilti::rt::integer::safe< std::uint64_t > &i) const |
Interval | operator* (double i) const |
operator bool () const | |
operator std::string () const | |
Represents HILTI's interval type. Intervals are stored with nanoseconds resolution. Intervals can be either positive or negative.
|
inlineexplicit |
Constructs an interval from an signed integer value.
nsecs | interval in nanoseconds. |
|
inlineexplicit |
Constructs an interval from a double value.
secs | interval in seconds. |
OutOfRange | if secs cannot be represented with the internal resolution |
|
inline |
Returns interval as nanoseconds.
|
inlineexplicit |
Returns true if the interval is non-zero.
|
inline |
Returns a humand-readable representation of the interval.
|
inline |
Returns interval as seconds.