(tty)
| 2 | let last_post = 0; |
| 3 | |
| 4 | function print(tty) { |
| 5 | if (tty.output && tty.output.length > 0) { |
| 6 | chunks.push(tty.output); |
| 7 | tty.output = []; |
| 8 | const now = performance.now(); |
| 9 | if (now - last_post > 100) { |
| 10 | post(); |
| 11 | last_post = now; |
| 12 | } |
| 13 | } |
| 14 | } |
| 15 | |
| 16 | function post() { |
| 17 | self.postMessage(chunks); |