28 namespace Timekeeper {
39 using namespace std::chrono;
42 hours hh = duration_cast<hours>(d);
43 minutes mm = duration_cast<minutes>(d % hours(1));
44 seconds ss = duration_cast<seconds>(d % minutes(1));
46 oss << right << setfill(
'0') << setw(2) << hh.count() <<
":" << setw(2) << mm.count() <<
":" << setw(2)
55 using namespace std::chrono;
58 hours hh = duration_cast<hours>(d);
59 minutes mm = duration_cast<minutes>(d % hours(1));
60 seconds ss = duration_cast<seconds>(d % minutes(1));
61 milliseconds milli = duration_cast<milliseconds>(d % seconds(1));
63 oss << right << setfill(
'0') << setw(2) << hh.count() <<
":" << setw(2) << mm.count() <<
":" << setw(2)
64 << ss.count() <<
":" << setw(3) << milli.count();
72 using namespace std::chrono;
75 hours hh = duration_cast<hours>(d);
76 minutes mm = duration_cast<minutes>(d % hours(1));
77 seconds ss = duration_cast<seconds>(d % minutes(1));
78 milliseconds milli = duration_cast<milliseconds>(d % seconds(1));
79 microseconds micro = duration_cast<microseconds>(d % milliseconds(1));
81 oss << right << setfill(
'0') << setw(2) << hh.count() <<
":" << setw(2) << mm.count() <<
":" << setw(2)
82 << ss.count() <<
":" << setw(3) << milli.count() <<
":" << setw(3) << micro.count();
90 using namespace std::chrono;
93 hours hh = duration_cast<hours>(d);
94 minutes mm = duration_cast<minutes>(d % hours(1));
95 seconds ss = duration_cast<seconds>(d % minutes(1));
96 milliseconds milli = duration_cast<milliseconds>(d % seconds(1));
97 microseconds micro = duration_cast<microseconds>(d % milliseconds(1));
98 nanoseconds nano = duration_cast<nanoseconds>(d % microseconds(1));
100 oss << right << setfill(
'0') << setw(2) << hh.count() <<
":" << setw(2) << mm.count() <<
":" << setw(2)
101 << ss.count() <<
":" << setw(3) << milli.count() <<
":" << setw(3) << micro.count() <<
":"
102 << setw(3) << nano.count() << endl;
static std::string ToColonString(std::chrono::milliseconds d)
Produce string in hh:mm:ss:mus format.
Utilities to tag clocks and to reformat number of ticks to a string.
static std::string ToColonString(std::chrono::nanoseconds d)
Produce string in hh:mm:ss:ms:mus:ns format.
static std::string ToColonString(std::chrono::microseconds d)
Produce string in hh:mm:ss:ms:mus format.
static std::string ToColonString(std::chrono::seconds d)
Procude string in hh:mm:ss format.