From 057a343aa3da5463a4e50f0fc2bbc7d47bdefa2d Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Tue, 23 Feb 2021 09:34:36 +0100 Subject: [PATCH] Minor convenience --- main.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.ts b/main.ts index e4769ea..8a1ff0a 100644 --- a/main.ts +++ b/main.ts @@ -57,6 +57,7 @@ const SetBox = Record.makeConstructor>('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 {