diff --git a/metamath-rs/src/database.rs b/metamath-rs/src/database.rs index f9117d2..86b5bf1 100644 --- a/metamath-rs/src/database.rs +++ b/metamath-rs/src/database.rs @@ -413,13 +413,15 @@ impl Default for Database { } pub(crate) fn time R>(opts: &DbOptions, name: &str, f: F) -> R { - let now = Instant::now(); - let ret = f(); if opts.timing { + let now = Instant::now(); + let ret = f(); // no as_msecs :( println!("{} {}ms", name, (now.elapsed() * 1000).as_secs()); + ret + } else { + f() } - ret } impl Drop for Database {