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(-)
@@ -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"
@@ -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" }
@@ -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);
}