Skip to content

Commit

Permalink
Merge pull request #2244 from CosmWasm/check-compile-time
Browse files Browse the repository at this point in the history
Show compile time in cosmwasm-check --verbose
  • Loading branch information
webmaster128 authored Sep 9, 2024
2 parents 0a71e98 + ccec965 commit 3b15bfb
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/check/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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(())
}

0 comments on commit 3b15bfb

Please sign in to comment.