mirror of
https://github.com/patarapolw/cjdic2.git
synced 2026-11-09 17:39:35 +00:00
(refractor) timer and warm up query
This commit is contained in:
1 parent
1b2ee0f691
commit
d6f2b145c3
13 files changed
+294
-47
No files matched your search
@@ -1,11 +1,10 @@
|
||||
use std::{
|
||||
fs::read_dir,
|
||||
path::{Path, absolute},
|
||||
time::Instant,
|
||||
};
|
||||
|
||||
use anyhow::{Context, Ok};
|
||||
use cjdic2_core::AppService;
|
||||
use cjdic2_core::{AppService, Timer};
|
||||
|
||||
mod common;
|
||||
use common::get_db_dir;
|
||||
@@ -24,16 +23,14 @@ fn main() -> Result<(), anyhow::Error> {
|
||||
let p = e.path();
|
||||
|
||||
if p.extension().and_then(|s| s.to_str()) == Some("zip") {
|
||||
let start = Instant::now();
|
||||
let _timer = Timer::new(format!("zip_file: {:?}", p));
|
||||
|
||||
println!("zip_file: {:?}", p);
|
||||
println!(
|
||||
"{:?}",
|
||||
AppService::import_yomitan_zip_file(&mut writer, &p, "ja", |progress| {
|
||||
println!("{:?}", progress);
|
||||
})?,
|
||||
);
|
||||
println!("[{:.2?}]", start.elapsed());
|
||||
} else {
|
||||
println!("not zip_file: {:?}", p);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user