Offers a chrono class.
More...
#include <wex/core/chrono.h>
|
| chrono (const std::string &format=TIME_FORMAT, precision_t precision=precision_t::SEC) |
| Default constructor.
|
|
std::string | get_time (time_t tt) const |
| Returns time string for a time_t. Precision is not used.
|
|
std::string | get_time (const timespec &ts) const |
| Returns time string for a timespec, using precision.
|
|
std::string | get_time (const std::chrono::time_point< std::chrono::system_clock > &tp) const |
| Returns time string for a time_point, using precision.
|
|
std::optional< time_t > | get_time (const std::string &time) const |
| Returns time_t for a time string.
|
|
|
static const std::string | TIME_FORMAT = "%Y-%m-%d %H:%M:%S" |
| The default time format.
|
|
◆ precision_t
Precision used for outputting time.
Enumerator |
---|
SEC | seconds
|
MILLI | millisecond
|
MICRO | microsecond
|
NANO | nanosecond
|