MCPcopy Create free account
hub / github.com/endbasic/endbasic / take_yield_decision

Method take_yield_decision

web/src/lib.rs:167–177  ·  view source on GitHub ↗

Consumes the current scheduling hints and returns the next browser yield decision.

(&self, now_ms: f64)

Source from the content-addressed store, hash-verified

165
166 /// Consumes the current scheduling hints and returns the next browser yield decision.
167 fn take_yield_decision(&self, now_ms: f64) -> YieldDecision {
168 let mut state = self.0.borrow_mut();
169 if state.paint_requested {
170 state.paint_requested = false;
171 YieldDecision::Paint
172 } else if (now_ms - state.last_host_yield_ms) >= Self::MAX_INTERVAL_MILLIS {
173 YieldDecision::Fairness
174 } else {
175 YieldDecision::Continue
176 }
177 }
178}
179
180#[async_trait(?Send)]

Callers 1

yield_nowMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected