36namespace triqs::utility {
49 auto now = std::chrono::system_clock::now();
50 std::time_t now_c = std::chrono::system_clock::to_time_t(now);
51 s << std::put_time(std::localtime(&now_c),
"%H:%M:%S");
62 auto s = std::chrono::seconds{int(sec)};
63 auto h = std::chrono::duration_cast<std::chrono::hours>(s);
64 auto m = std::chrono::duration_cast<std::chrono::minutes>(s -= h);
66 std::ostringstream os;
67 os << std::setfill(
'0') << std::setw(2) << h.count() <<
":" << std::setfill(
'0') << std::setw(2) << m.count() <<
":" << std::setfill(
'0')
68 << std::setw(2) << s.count();
85 double eta = (N - 1 - n) *
double(t) / (n + 1);
Accumulating wall-clock timer based on std::chrono::high_resolution_clock.
std::string estimate_time_left(int N, int n, timer &t)
Linear extrapolation of the remaining time of a loop, formatted as HH:MM:SS.
std::string timestamp()
Current local time formatted as HH:MM:SS.
std::string hours_minutes_seconds_from_seconds(double sec)
Format an absolute number of seconds as HH:MM:SS.
A wall-clock timer that accumulates elapsed seconds across start/stop intervals.