void print(const string& res_str, maxint_t res, double time) { if (print_status()) { cout << "\r" << string(50,' ') << "\r"; cout << "Status: 100%" << endl; cout << res_str << " = " << res << endl; print_seconds(get_wtime() - time); } }
void print_uptime(void) { FILE * f = fopen("/proc/uptime", "r"); if (!f) return; int seconds, subseconds; fscanf(f, "%d.%2d", &seconds, &subseconds); printf("up "); print_seconds(seconds); }