Skip to content

Commit

Permalink
Handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacarte committed Aug 24, 2023
1 parent c84b9d6 commit e85e738
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions host_based/stacking/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,7 @@ fn main() -> Result<(), anyhow::Error> {
let mut C = 0;

let now = std::time::Instant::now();
let mut total_elapsed_millis = 0;
loop {
let opsclone = opts.clone();
if opts.chaos_mode {
Expand Down Expand Up @@ -516,8 +517,9 @@ fn main() -> Result<(), anyhow::Error> {
if let Some(oracle) = &opsclone.oracle {
// Pause the timer to skip oracle time
let elapsed = now.elapsed();
total_elapsed_millis += elapsed.as_millis();
if call_oracle(oracle.clone(), format!("{}.{}.{}.chaos.cwasm", opts.output.to_str().unwrap(), hash2, hash)) {
eprintln!("Elapsed time until oracle: {}s", elapsed.as_millis());
eprintln!("Elapsed time until oracle: {}ms", total_elapsed_millis);
eprintln!("Oracle returned 1, we stop");
std::process::exit(0);
}
Expand All @@ -527,10 +529,10 @@ fn main() -> Result<(), anyhow::Error> {
} else {
if let Some(oracle) = &opsclone.oracle {
let elapsed = now.elapsed();

total_elapsed_millis += elapsed.as_millis();
if call_oracle(oracle.clone(), format!("{}.{}.{}.chaos.wasm", opts.output.to_str().unwrap(), hash2, hash)) {
// The oracle returned 1, we stop
let elapsed = now.elapsed();
eprintln!("Elapsed time until oracle: {}ms", total_elapsed_millis);
eprintln!("Oracle returned 1, we stop");
std::process::exit(0);
}
Expand Down

0 comments on commit e85e738

Please sign in to comment.