index : smol-guess.git

ascending towards madness

author holly sparkles <sparkles@holly.sh> 2024-01-14 18:45:45.0 +00:00:00
committer holly sparkles <sparkles@holly.sh> 2024-01-14 18:45:45.0 +00:00:00
commit
9ba945059f78a9a564778eda72ca11e267c9ef22 [patch]
tree
d890afc53772494db2c732c53e6b51642f66738c
parent
b644f60bc5163461863cbd5ec77daeb4f6fe4ba1
download
9ba945059f78a9a564778eda72ca11e267c9ef22.tar.gz

feat: add a stopwatch to time operations



Diff

 Cargo.lock  |  6 ++++++
 Cargo.toml  |  1 +
 src/main.rs |  9 ++++++++-
 3 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/Cargo.lock b/Cargo.lock
index a0adbe7..c4387e7 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -164,9 +164,15 @@ version = "0.1.0"
dependencies = [
 "git2",
 "itertools",
 "stopwatch",
]

[[package]]
name = "stopwatch"
version = "0.1.0"
source = "git+https://git.holly.sh/stopwatch.git#f6221643a92c90649c4568015c7e82d112a68e0b"

[[package]]
name = "tinyvec"
version = "1.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/Cargo.toml b/Cargo.toml
index a89c501..5c1eebb 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -8,3 +8,4 @@ edition = "2021"
[dependencies]
git2 = "0.18.1"
itertools = "0.12.0"
stopwatch = { git = "https://git.holly.sh/stopwatch.git", version = "0.1.0" }
diff --git a/src/main.rs b/src/main.rs
index 6b41103..39a1cfd 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -13,6 +13,9 @@ fn main() {
        std::process::exit(1);
    }

    let mut stopwatch = stopwatch::Stopwatch::new();
    stopwatch.start();

    let repo_languages: Vec<LanguageMatch> = LanguageDefinitions::default()
        .load_builtins()
        .identify_files(repository::get_bare_repository_files(PathBuf::from(
@@ -34,5 +37,9 @@ fn main() {

    sorted_groups
        .iter()
        .for_each(|item| println!("{}: {}", item.0, item.1.len()))
        .for_each(|item| println!("{}: {}", item.0, item.1.len()));

    stopwatch.stop();

    println!("\nOperation complete in {}", stopwatch);
}