38 using namespace std::chrono;
41 hours hh = duration_cast<hours>(d);
42 minutes mm = duration_cast<minutes>(d % hours(1));
43 seconds ss = duration_cast<seconds>(d % minutes(1));
45 oss << right << setfill(
'0') << setw(2) << hh.count() <<
":" << setw(2) << mm.count()
46 <<
":" << setw(2) << ss.count();
53 using namespace std::chrono;
56 hours hh = duration_cast<hours>(d);
57 minutes mm = duration_cast<minutes>(d % hours(1));
58 seconds ss = duration_cast<seconds>(d % minutes(1));
59 milliseconds milli = duration_cast<milliseconds>(d % seconds(1));
61 oss << right << setfill(
'0') << setw(2) << hh.count() <<
":" << setw(2) << mm.count()
62 <<
":" << setw(2) << ss.count() <<
":" << setw(3) << milli.count();
69 using namespace std::chrono;
72 hours hh = duration_cast<hours>(d);
73 minutes mm = duration_cast<minutes>(d % hours(1));
74 seconds ss = duration_cast<seconds>(d % minutes(1));
75 milliseconds milli = duration_cast<milliseconds>(d % seconds(1));
76 microseconds micro = duration_cast<microseconds>(d % milliseconds(1));
78 oss << right << setfill(
'0') << setw(2) << hh.count() <<
":" << setw(2) << mm.count()
79 <<
":" << setw(2) << ss.count() <<
":" << setw(3) << milli.count() <<
":" << setw(3) << micro.count();
86 using namespace std::chrono;
89 hours hh = duration_cast<hours>(d);
90 minutes mm = duration_cast<minutes>(d % hours(1));
91 seconds ss = duration_cast<seconds>(d % minutes(1));
92 milliseconds milli = duration_cast<milliseconds>(d % seconds(1));
93 microseconds micro = duration_cast<microseconds>(d % milliseconds(1));
94 nanoseconds nano = duration_cast<nanoseconds>(d % microseconds(1));
96 oss << right << setfill(
'0') << setw(2) << hh.count() <<
":" << setw(2) << mm.count()
97 <<
":" << setw(2) << ss.count() <<
":" << setw(3) << milli.count() <<
":" << setw(3) << micro.count()
98 <<
":" << setw(3) << nano.count() << endl;
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.
Time Dependent Person DataType.
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)
Produce string in hh:mm:ss format.
static std::string toColonString(std::chrono::milliseconds d)
Produce string in hh:mm:ss:mus format.