(item, msecs, start = binding.getLibuvNow())
| 385 | |
| 386 | // We need to use the binding as the receiver for fast API calls. |
| 387 | function insert(item, msecs, start = binding.getLibuvNow()) { |
| 388 | // Truncate so that accuracy of sub-millisecond timers is not assumed. |
| 389 | msecs = MathTrunc(msecs); |
| 390 | item._idleStart = start; |
| 391 | |
| 392 | // Use an existing list if there is one, otherwise we need to make a new one. |
| 393 | let list = timerListMap[msecs]; |
| 394 | if (list === undefined) { |
| 395 | debug('no %d list was found in insert, creating a new one', msecs); |
| 396 | const expiry = start + msecs; |
| 397 | timerListMap[msecs] = list = new TimersList(expiry, msecs); |
| 398 | timerListQueue.insert(list); |
| 399 | |
| 400 | if (nextExpiry > expiry) { |
| 401 | // We need to use the binding as the receiver for fast API calls. |
| 402 | binding.scheduleTimer(msecs); |
| 403 | nextExpiry = expiry; |
| 404 | } |
| 405 | } |
| 406 | |
| 407 | L.append(list, item); |
| 408 | } |
| 409 | |
| 410 | function setUnrefTimeout(callback, after) { |
| 411 | // Type checking identical to setTimeout() |
no test coverage detected
searching dependent graphs…