-
Notifications
You must be signed in to change notification settings - Fork 20
Timeboxed System
Daan van Yperen edited this page Aug 10, 2015
·
5 revisions
Processes entities until time runs out. Continues where it left off next invocation.
Drop in replacement for EntityProcessingSystem
.
Best used to time constrain and spread out high numbers of small or predictable entity operations, while maximizing throughput.
System runtime can overrun by (at most) one full entity operation.
public class MyExpensiveSystem extends TimeboxedProcessingSystem {
@Override
protected void process(Entity e) {
doAction(e);
}
@Override
protected float getAllottedTime() {
return 0.005f; // run for 5ms
}
}