D++ (DPP)
C++ Discord API Bot Library
|
A class used to represent an uptime in hours, minutes, seconds and days, with helper functions to convert from time_t and display as a string. More...
#include <utility.h>
Public Member Functions | |
uptime () | |
Construct a new uptime object. More... | |
uptime (time_t diff) | |
Construct a new uptime object. More... | |
std::string | to_string () |
Get uptime as string. More... | |
uint64_t | to_secs () |
Get uptime as seconds. More... | |
uint64_t | to_msecs () |
Get uptime as milliseconds. More... | |
Public Attributes | |
uint16_t | days |
Number of days. More... | |
uint8_t | hours |
Number of hours. More... | |
uint8_t | mins |
Number of minutes. More... | |
uint8_t | secs |
Number of seconds. More... | |
A class used to represent an uptime in hours, minutes, seconds and days, with helper functions to convert from time_t and display as a string.
dpp::utility::uptime::uptime | ( | ) |
Construct a new uptime object.
dpp::utility::uptime::uptime | ( | time_t | diff | ) |
Construct a new uptime object.
diff | A time_t to initialise the object from |
uint64_t dpp::utility::uptime::to_msecs | ( | ) |
Get uptime as milliseconds.
uint64_t dpp::utility::uptime::to_secs | ( | ) |
Get uptime as seconds.
std::string dpp::utility::uptime::to_string | ( | ) |
Get uptime as string.
uint16_t dpp::utility::uptime::days |
Number of days.
uint8_t dpp::utility::uptime::hours |
Number of hours.
uint8_t dpp::utility::uptime::mins |
Number of minutes.
uint8_t dpp::utility::uptime::secs |
Number of seconds.