MCPcopy Create free account
hub / github.com/AI45Lab/Code / get_idle_duration_ms

Method get_idle_duration_ms

core/src/ahp/executor.rs:334–341  ·  view source on GitHub ↗

Get idle duration in milliseconds.

(&self)

Source from the content-addressed store, hash-verified

332
333 /// Get idle duration in milliseconds.
334 pub fn get_idle_duration_ms(&self) -> u64 {
335 let last = self.last_activity.load(Ordering::Relaxed);
336 let now = std::time::SystemTime::now()
337 .duration_since(std::time::UNIX_EPOCH)
338 .unwrap()
339 .as_millis() as u64;
340 now.saturating_sub(last)
341 }
342
343 /// Check if agent is idle and create idle event if threshold exceeded.
344 pub fn check_idle(&self) -> Option<IdleEvent> {

Callers 3

runtime_snapshotMethod · 0.80
check_idleMethod · 0.80

Calls 2

nowFunction · 0.85
loadMethod · 0.45

Tested by 1