Allow to print stats when recv ctrlc

This commit is contained in:
2025-07-31 17:27:39 +08:00
parent 334acbb633
commit 3282f3b980
3 changed files with 35 additions and 0 deletions

View File

@@ -1540,6 +1540,11 @@ lazy_static::lazy_static! {
}
fn main() {
let _ = ctrlc::try_set_handler(|| {
eprintln!("Aborted.");
eprintln!("{}", std::ops::Deref::deref(&COUNTER));
std::process::exit(1);
});
let arg = args::parse_args();
if arg.backtrace {
unsafe { std::env::set_var("RUST_LIB_BACKTRACE", "1") };