Skip to content

Commit

Permalink
Workaround progress bar issues
Browse files Browse the repository at this point in the history
See details at r-lib/progress#94
  • Loading branch information
jimhester committed May 14, 2019
1 parent f08e3c3 commit 2fd73a3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/multi_progress.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,26 @@ class multi_progress {
std::string format = "[:bar] :percent",
size_t total = 100,
int width = 78,
const char complete_char = '=',
const char incomplete_char = '-',
const char* complete_char = "=",
const char* incomplete_char = "-",
bool clear = true,
double show_after = 0.2)
: pb_(new RProgress::RProgress(
format,
total,
width,
complete_char,
complete_char,
incomplete_char,
clear,
show_after)),
progress_(0),
total_(total),
last_progress_(0),
last_time_(std::chrono::system_clock::now()),
update_interval_(10) {}
update_interval_(10) {
pb_->set_reverse(false);
}

void tick(size_t progress) {
std::lock_guard<std::mutex> guard(mutex_);
Expand Down

0 comments on commit 2fd73a3

Please sign in to comment.