: test-throughput ( -- )
    chan.make   # work
    chan.make   # results

    2dup [ over chan.receive drop 10 time.sleep-ms 1 i.+ swap chan.send drop drop ] strand.spawn drop
    drop drop
    2dup [ over chan.receive drop 10 time.sleep-ms 1 i.+ swap chan.send drop drop ] strand.spawn drop
    drop drop

    over 10 swap chan.send drop
    over 20 swap chan.send drop
    over 30 swap chan.send drop
    over 40 swap chan.send drop

    # Receive 4 results and sum
    dup chan.receive drop
    over chan.receive drop i.+
    over chan.receive drop i.+
    over chan.receive drop i.+
    nip nip   # drop channels

    104 test.assert-eq
;
