40 start_time_(
ros::WallTime::now()),
73 printf(
"\r [PAUSED] %.2f%% Complete, Elapsed: %s Estimated Remaining: %s \r",
80 printf(
"\r [RUNNING] %.2f%% Complete, Elapsed: %s Estimated Remaining: %s \r",
90 printf(
"\r [PAUSED] %.2f%% Complete, Elapsed: %s \r",
96 printf(
"\r [RUNNING] %.2f%% Complete, Elapsed: %s \r",
110 bool charsleftorpaused =
true;
111 while (charsleftorpaused &&
ros::ok())
144 return static_cast<signed char>(EOF);
152 const int fd = fileno(stdin);
156 flags.c_lflag &= ~ICANON;
157 flags.c_cc[VMIN] = 0;
159 flags.c_cc[VTIME] = 0;
160 tcsetattr(fd, TCSANOW, &flags);
169 const int fd = fileno(stdin);
175 int days =
static_cast<int>(seconds / 86400.0);
176 seconds -= days * 86400.0;
178 int hours =
static_cast<int>(seconds / 3600.0);
179 seconds -= hours * 3600.0;
181 int minutes =
static_cast<int>(seconds / 60.0);
182 seconds -= minutes * 60.0;
192 if (hours > 0 || !time.empty())
202 if (minutes > 0 || !time.empty())
224 std::stringstream ss;
226 ss << std::setfill(
'0');
227 ss << std::setw(width);