(i)
| 33 | let last_ts = 0; |
| 34 | |
| 35 | function f(i) { |
| 36 | if (i <= N) { |
| 37 | // check order |
| 38 | assert.strictEqual(i, last_i + 1, `order is broken: ${i} != ${last_i} + 1`); |
| 39 | last_i = i; |
| 40 | |
| 41 | // Check that this iteration is fired at least 1ms later than the previous |
| 42 | // We need to use the binding as the receiver for fast API calls. |
| 43 | const now = binding.getLibuvNow(); |
| 44 | assert(now >= last_ts + 1, |
| 45 | `current ts ${now} < prev ts ${last_ts} + 1`); |
| 46 | last_ts = now; |
| 47 | |
| 48 | // Schedule next iteration |
| 49 | setTimeout(f, 1, i + 1); |
| 50 | } |
| 51 | } |
| 52 | setTimeout(f, 1, 1); |
nothing calls this directly
no test coverage detected