Expand description
Timer implementation
This module provides both sync and async timer functionality:
- Sync timers are mounted on the global object:
- setTimeout/clearTimeout (sync)
- setInterval/clearInterval (sync)
- Async timers are mounted under global.timer:
- setTimeout/clearTimeout (async)
- setInterval/clearInterval (async)
- setImmediate (async)
§Features
- Sync timers for traditional callback-based usage
- Async timers that return Promises for modern async/await patterns
§Limitations
- Unlike Web APIs, this implementation does not support passing additional arguments to the callback function. Only the callback function and delay are supported.
- Delay is in milliseconds and should be a positive number.