(msecs, name)
| 419 | |
| 420 | // Type checking used by timers.enroll() and Socket#setTimeout() |
| 421 | function getTimerDuration(msecs, name) { |
| 422 | validateNumber(msecs, name); |
| 423 | if (msecs < 0 || !NumberIsFinite(msecs)) { |
| 424 | throw new ERR_OUT_OF_RANGE(name, 'a non-negative finite number', msecs); |
| 425 | } |
| 426 | |
| 427 | // Ensure that msecs fits into signed int32 |
| 428 | if (msecs > TIMEOUT_MAX) { |
| 429 | process.emitWarning(`${msecs} does not fit into a 32-bit signed integer.` + |
| 430 | `\nTimer duration was truncated to ${TIMEOUT_MAX}.`, |
| 431 | 'TimeoutOverflowWarning'); |
| 432 | return TIMEOUT_MAX; |
| 433 | } |
| 434 | |
| 435 | return msecs; |
| 436 | } |
| 437 | |
| 438 | function compareTimersLists(a, b) { |
| 439 | const expiryDiff = a.expiry - b.expiry; |
no outgoing calls
no test coverage detected
searching dependent graphs…