From ccec965a07897bd0879db758eba3298216130bab Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Thu, 5 Sep 2024 18:02:34 +0200 Subject: [PATCH] Show compile time in cosmwasm-check --verbose --- packages/check/src/main.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/check/src/main.rs b/packages/check/src/main.rs index 559fbc364..e211a405b 100644 --- a/packages/check/src/main.rs +++ b/packages/check/src/main.rs @@ -3,6 +3,7 @@ use std::fs::File; use std::io::Read; use std::path::Path; use std::process::exit; +use std::time::Instant; use anyhow::Context; use clap::{Arg, ArgAction, Command}; @@ -156,8 +157,15 @@ fn check_contract( check_wasm(&wasm, available_capabilities, wasm_limits, logs)?; // Compile module - let engine = make_compiling_engine(None); - let _module = compile(&engine, &wasm)?; + let start = Instant::now(); + { + let engine = make_compiling_engine(None); + let _module = compile(&engine, &wasm)?; + } + if verbose { + let duration = start.elapsed(); + eprintln!("Compile time: {:?}", duration); + } Ok(()) }