diff --git a/src/inspectors/timeout.rs b/src/inspectors/timeout.rs index 82a584c..7698b1a 100644 --- a/src/inspectors/timeout.rs +++ b/src/inspectors/timeout.rs @@ -57,7 +57,9 @@ impl TimeLimit { /// Check if the timeout has been reached. pub fn has_elapsed(&self) -> bool { - self.execution_start.elapsed() >= self.duration + let elapsed = self.execution_start.elapsed(); + println!("elapsed: {elapsed:?}, duration: {}ms", self.duration.as_millis()); + elapsed >= self.duration } /// Set the execution start time to [`Instant::now`]. This is invoked during [`Inspector::initialize_interp`]. @@ -85,16 +87,19 @@ impl Inspector, Int> for TimeLimit } fn call(&mut self, ctx: &mut Ctx, _inputs: &mut CallInputs) -> Option { + println!("call"); check_timeout!(self, ctx); None } fn call_end(&mut self, ctx: &mut Ctx, _inputs: &CallInputs, _outcome: &mut CallOutcome) { + println!("call_end"); check_timeout!(self, ctx); } fn create(&mut self, ctx: &mut Ctx, _inputs: &mut CreateInputs) -> Option { + println!("create"); check_timeout!(self, ctx); None @@ -106,6 +111,7 @@ impl Inspector, Int> for TimeLimit _inputs: &CreateInputs, _outcome: &mut CreateOutcome, ) { + println!("create_end"); check_timeout!(self, ctx); } @@ -114,6 +120,7 @@ impl Inspector, Int> for TimeLimit ctx: &mut Ctx, _inputs: &mut EOFCreateInputs, ) -> Option { + println!("eofcreate"); check_timeout!(self, ctx); None @@ -125,6 +132,7 @@ impl Inspector, Int> for TimeLimit _inputs: &EOFCreateInputs, _outcome: &mut CreateOutcome, ) { + println!("eofcreate_end"); check_timeout!(self, ctx); } }