MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / set_time_hook

Method set_time_hook

compiler/src/modules/vm/helpers.rs:38–38  ·  view source on GitHub ↗

Host-provided wall clock (ns); without one, `sleep` advances a deterministic virtual clock.

(&mut self, hook: fn() -> u64)

Source from the content-addressed store, hash-verified

36
37 /// Host-provided wall clock (ns); without one, `sleep` advances a deterministic virtual clock.
38 pub fn set_time_hook(&mut self, hook: fn() -> u64) { self.time_hook = Some(hook); }
39 pub(crate) fn now_ns(&self) -> u64 {
40 match self.time_hook { Some(h) => h(), None => self.virtual_clock_ns }
41 }

Callers 2

run_startFunction · 0.80
runFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected