triskele/include/triskeleDebug.tpp
François Merciol ebdc90f26f Le test continue
2018-08-04 11:14:02 +02:00

25 lines
603 B
C++

#ifndef _OTB_TRISKELE_DEBUG_TPP
#define _OTB_TRISKELE_DEBUG_TPP
string
ns2string (double delta) {
using namespace boost::chrono;
ostringstream oss;
duration<double> ns (delta);
oss.fill ('0');
// typedef duration<int, ratio<86400> > days;
// auto d = duration_cast<days>(ns);
// ns -= d;
auto h = duration_cast<hours> (ns);
ns -= h;
auto m = duration_cast<minutes> (ns);
ns -= m;
oss << setw (2) << h.count () << ":"
<< setw (2) << m.count () << ":"
<< setw (9) << fixed << setprecision (6) << ns.count ();
return oss.str ();
}
#endif // _OTB_TRISKELE_DEBUG_TPP