pub struct EngineClock(/* private fields */);Expand description
Patch form of a fingerprinted state envelope, against the last one sent to
this seat. None the first time a seat is served, or if anything is missing,
and the caller falls back to the full state, which is always correct.
When the engine host last received a player’s response, as milliseconds on
its own monotonic clock. The response path writes it and the emit path
reads it, so an outgoing envelope can say how long the engine took without
anyone comparing clocks across hosts.
Implementations§
Source§impl EngineClock
impl EngineClock
pub fn mark_response(&self)
Sourcepub fn mark_decision_complete(&self)
pub fn mark_decision_complete(&self)
Cleared once the decision it was timing completes, so an envelope emitted later, while a player is thinking, cannot report that wait as engine time.
Sourcepub fn elapsed_ms(&self) -> Option<u32>
pub fn elapsed_ms(&self) -> Option<u32>
Milliseconds since the last response, or None if none has arrived yet
or the decision it was timing has already completed.
There is deliberately no upper bound. Idle time used to be excluded by
discarding anything past 120s, which also discarded the slow decisions
the metric exists to expose: a real 175s decision reported no engineMs
at all, so the field was absent exactly when it mattered and every
quantile built from it was understated. mark_decision_complete draws
that line by state instead of by duration.
Trait Implementations§
Source§impl Clone for EngineClock
impl Clone for EngineClock
Source§fn clone(&self) -> EngineClock
fn clone(&self) -> EngineClock
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more