32 std::chrono::time_point<std::chrono::steady_clock>
oriTime;
36 printf(
"\x1b[%d;%dm%s\x1b[%dm \x1b[0;0m\x1b[0m %s\n", 40, 33,
"HiFPlacer CMD: ", 0, tmp_string.c_str());
41 printf(
"\x1b[%d;%dm%s\x1b[%dm \x1b[0;0m\x1b[0m %s\n", 40, 34,
"HiFPlacer INFO: ", 0, tmp_string.c_str());
46 auto nowTime = std::chrono::steady_clock::now();
47 auto millis = std::chrono::duration_cast<std::chrono::milliseconds>(nowTime -
oriTime).count();
48 printf(
"\x1b[%d;%dm%s\x1b[%dm \x1b[0;0m\x1b[0m %s (elapsed time: %.3lf s)\n", 40, 32,
"HiFPlacer STATUS: ", 0,
49 tmp_string.c_str(), (
double)millis / 1000);
54 printf(
"\x1b[%d;%dm%s\x1b[%dm \x1b[0;0m\x1b[0m %s\n", 43, 31,
"HiFPlacer ERROR: ", 0, tmp_string.c_str());
59 printf(
"\x1b[%d;%dm%s\x1b[%dm \x1b[0;0m\x1b[0m %s\n", 43, 31,
"HiFPlacer WARNING: ", 0, tmp_string.c_str());
64 return __gnu_cxx::__to_xstring<std::string>(&std::vsnprintf, 4 *
sizeof(
int),
"%3d", __val);
67 #define PBSTR "||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||"
72 int val = (int)(percentage * 100);
73 int lpad = (int)(percentage *
PBWIDTH);
75 printf(
"\r%3d%% [%.*s%*s]", val, lpad,
PBSTR, rpad,
"");