Minor convenience

This commit is contained in:
Tony Garnock-Jones 2021-02-23 09:34:36 +01:00
parent 2846c8cbe0
commit 057a343aa3
1 changed files with 3 additions and 2 deletions

View File

@ -57,6 +57,7 @@ const SetBox = Record.makeConstructor<Ref<Entity>>('SetBox', ['newValue']);
let startTime = Date.now();
let prevValue = 0;
const LIMIT = 500000;
Turn.for(null, async (t: Turn) => {
const ds = new Ref(new Actor(), new Dataspace());
@ -78,7 +79,7 @@ Turn.for(null, async (t: Turn) => {
startTime = endTime;
console.log(`Box: got ${newValue} (${count / delta} Hz)`);
}
if (newValue === 280000) t.quit();
if (newValue === LIMIT - 20000) t.quit();
setValue(t, newValue);
}
})));
@ -91,7 +92,7 @@ Turn.for(null, async (t: Turn) => {
t.assert(ds, Observe(BoxState.constructorInfo.label, t.ref({
[assert](t: Turn, [currentValue]: [number]): void {
// console.log(`Client: got ${currentValue}`);
if (currentValue === 300000) {
if (currentValue === LIMIT) {
console.log(`Client: quitting at limit`);
t.quit();
} else {