![]() |
Spicy
|
#include <time.h>
Classes | |
| struct | NanosecondTag |
| struct | SecondTag |
Public Member Functions | |
| Time ()=default | |
| Time (const hilti::rt::integer::safe< uint64_t > &nsecs, NanosecondTag) | |
| Time (double secs, SecondTag) | |
| Time (const Time &)=default | |
| Time (Time &&) noexcept=default | |
| Time & | operator= (const Time &)=default |
| Time & | operator= (Time &&) noexcept=default |
| double | seconds () const |
| uint64_t | nanoseconds () const |
| bool | operator== (const Time &other) const |
| bool | operator!= (const Time &other) const |
| bool | operator< (const Time &other) const |
| bool | operator<= (const Time &other) const |
| bool | operator> (const Time &other) const |
| bool | operator>= (const Time &other) const |
| Time | operator+ (const Interval &other) const |
| Time | operator- (const Interval &other) const |
| Interval | operator- (const Time &other) const |
| operator std::string () const | |
Represents HILTI's time type. Intervals are stored as nanoseconds resolution as intervals since the UNIX epoch.
|
default |
Constructs null Time value.
|
inlineexplicit |
Constructs an interval from an unsigned integer value.
| nsecs | interval in nanoseconds. |
|
inlineexplicit |
Constructs a time from a double value.
| secs | seconds since the UNIX epoch. |
| OutOfRange | if secs cannot be represented with the internal resolution |
|
inline |
Returns nanoseconds since epoch.
| Time::operator std::string | ( | ) | const |
Returns a human-readable representation of the time.
|
inline |
Returns a UNIX timestamp.