-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from a8m/feat/finish_api
Feat/finish api
- Loading branch information
Showing
10 changed files
with
128 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
extern crate pbr; | ||
use pbr::ProgressBar; | ||
use std::thread; | ||
use std::time::Duration; | ||
|
||
fn main() { | ||
let count = 30; | ||
let mut pb = ProgressBar::new(count * 10); | ||
pb.tick_format("\\|/-"); | ||
pb.format("|#--|"); | ||
pb.show_tick = true; | ||
pb.show_speed = false; | ||
pb.show_percent = false; | ||
pb.show_counter = false; | ||
pb.show_time_left = false; | ||
pb.inc(); | ||
for _ in 0..count { | ||
for _ in 0..10 { | ||
pb.message("normalize -> thing "); | ||
thread::sleep(Duration::from_millis(80)); | ||
pb.tick(); | ||
} | ||
for _ in 0..10 { | ||
pb.message("fuzz -> tree "); | ||
thread::sleep(Duration::from_millis(80)); | ||
pb.inc(); | ||
} | ||
} | ||
pb.finish_println("done!"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
extern crate rand; | ||
extern crate pbr; | ||
use rand::Rng; | ||
use pbr::ProgressBar; | ||
use std::thread; | ||
use std::time::Duration; | ||
|
||
fn main() { | ||
let count = 500; | ||
let mut pb = ProgressBar::new(count); | ||
pb.format("╢▌▌░╟"); | ||
for _ in 0..count { | ||
pb.inc(); | ||
let n = rand::thread_rng().gen_range(0, 100); | ||
thread::sleep(Duration::from_millis(n)); | ||
} | ||
pb.finish_println("done!"); | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters