RosettaCodeData/Task/Checkpoint-synchronization/J/checkpoint-synchronization.j

13 lines
530 B
Plaintext

{{for. y do. 0 T.'' end.}} 0>.4-1 T.'' NB. make sure we have some threads
ts=: 6!:0 NB. timestamp
dl=: 6!:3 NB. delay
{{r=.EMPTY for. i.y do. dl 1[ r=.r,3}.ts'' end. r}} t. ''"0(3 5)
┌────────────┬────────────┐
│12 53 53.569│12 53 53.569│
│12 53 54.578│12 53 54.578│
│12 53 55.587│12 53 55.587│
│ │12 53 56.603│
│ │12 53 57.614│
└────────────┴────────────┘