Timespan example
#include <iostream>
#include <string>
int main(int argc, char** argv)
{
std::cout << "Please enter timespan milliseconds as an integer number..." << std::endl;
std::string line;
getline(std::cin, line);
int milliseconds = std::stoi(line);
std::cout <<
"Timespan.days() = " << timespan.
days() << std::endl;
std::cout <<
"Timespan.hours() = " << (timespan.
hours() % 24) << std::endl;
std::cout <<
"Timespan.minutes() = " << (timespan.
minutes() % 60) << std::endl;
std::cout <<
"Timespan.seconds() = " << (timespan.
seconds() % 60) << std::endl;
std::cout <<
"Timespan.milliseconds() = " << (timespan.
milliseconds() % 1000) << std::endl;
return 0;
}
int64_t seconds() const noexcept
Get total seconds of the current timespan.
int64_t days() const noexcept
Get total days of the current timespan.
int64_t milliseconds() const noexcept
Get total milliseconds of the current timespan.
int64_t minutes() const noexcept
Get total minutes of the current timespan.
int64_t hours() const noexcept
Get total hours of the current timespan.