Skip to content

Commit

Permalink
Set progress bar draw rate to 1 per second
Browse files Browse the repository at this point in the history
To lower progress bar overhead, we only refresh the progress bar once a second.
  • Loading branch information
jqnatividad committed Nov 3, 2021
1 parent b9bb72c commit e590a21
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/cmd/apply.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
if !args.flag_quiet {
record_count = util::count_rows(&rconfig);
util::prep_progress(&progress, record_count);
progress.set_draw_rate(1);
}

let mut record = csv::StringRecord::new();
Expand Down
1 change: 1 addition & 0 deletions src/cmd/foreach.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
if !args.flag_quiet {
record_count = util::count_rows(&rconfig);
util::prep_progress(&progress, record_count);
progress.set_draw_rate(1);
}

while rdr.read_byte_record(&mut record)? {
Expand Down
1 change: 1 addition & 0 deletions src/cmd/lua.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
if !args.flag_quiet {
record_count = util::count_rows(&rconfig);
util::prep_progress(&progress, record_count);
progress.set_draw_rate(1);
}

let mut record = csv::StringRecord::new();
Expand Down

0 comments on commit e590a21

Please sign in to comment.