#include <iostream>
#include <thread>
{
std::cout <<
"Timestamp.days() = " << timestamp.
days() << std::endl;
std::cout <<
"Timestamp.hours() = " << (timestamp.
hours() % 24) << std::endl;
std::cout <<
"Timestamp.minutes() = " << (timestamp.
minutes() % 60) << std::endl;
std::cout <<
"Timestamp.seconds() = " << (timestamp.
seconds() % 60) << std::endl;
std::cout <<
"Timestamp.milliseconds() = " << (timestamp.
milliseconds() % 1000) << std::endl;
std::cout << std::endl;
}
int main(int argc, char** argv)
{
for (int i = 0; i < 10; ++i)
{
std::this_thread::yield();
}
std::cout << std::endl;
std::cout << "Epoch timestamp:" << std::endl;
std::cout << "UTC timestamp:" << std::endl;
std::cout << "Local timestamp:" << std::endl;
std::cout << "Nano timestamp:" << std::endl;
std::cout << "RDTS timestamp:" << std::endl;
return 0;
}
High resolution timestamp.
uint64_t minutes() const noexcept
Get total minutes of the current timestamp.
static uint64_t local()
Get the local timestamp.
uint64_t milliseconds() const noexcept
Get total milliseconds of the current timestamp.
static uint64_t utc()
Get the UTC timestamp.
static uint64_t nano()
Get the high resolution timestamp.
uint64_t seconds() const noexcept
Get total seconds of the current timestamp.
static uint64_t rdts()
Get the current value of RDTS (Read Time Stamp Counter)
uint64_t hours() const noexcept
Get total hours of the current timestamp.
uint64_t days() const noexcept
Get total days of the current timestamp.