summaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/main.rs b/src/main.rs
index 7fc8991..272eec1 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -4,18 +4,21 @@ use std::io;
use std::io::Write;
use std::path::Path;
use std::process::Command;
+use std::time::SystemTime;
fn eval(paths: &[&str], prompt: &str) {
let mut bins: Vec<String> = Vec::new();
- for path in paths {
- let files = fs::read_dir(path).expect("Unable to read files in your path");
- for file in files {
- bins.push(file.unwrap().path().display().to_string());
+ loop {
+ let now = SystemTime::now();
+ for path in paths {
+ let files = fs::read_dir(path).expect("Unable to read files in your path");
+ for file in files {
+ bins.push(file.unwrap().path().display().to_string());
+ }
}
- }
+ println!("Refresh: {} ms", now.elapsed().unwrap().as_millis());
- loop {
// Output the prompt
io::stdout().flush().unwrap();
print!("{}", prompt);