(times)
| 11 | .then(() => seq.close()); |
| 12 | |
| 13 | async function sayHello(times) { |
| 14 | for(let n = 0; n <= times; n++){ |
| 15 | await new Promise((accept) => setTimeout(accept, 1 * 1000)); // Waits 1 second before each round |
| 16 | |
| 17 | console.log('Round ', n); |
| 18 | seq.emit({ |
| 19 | timestamp: new Date(), |
| 20 | level: 'Information', |
| 21 | messageTemplate: 'Hello for the {n}th time, {user}!', |
| 22 | properties: { |
| 23 | user: process.env.USERNAME, |
| 24 | n: n |
| 25 | } |
| 26 | }); |
| 27 | |
| 28 | if (n % 5 == 0) { // Flush every 5 events |
| 29 | seq.flush(); |
| 30 | } |
| 31 | } |
| 32 | } |
no test coverage detected