Minor convenience
This commit is contained in:
parent
2846c8cbe0
commit
057a343aa3
5
main.ts
5
main.ts
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue