mirror of
https://github.com/denoland/deno.git
synced 2025-07-24 13:44:08 +00:00
Simplify timer with macrotask callback (#4385)
This commit is contained in:
parent
8c1c929034
commit
2f3de4b425
6 changed files with 140 additions and 77 deletions
|
@ -7,6 +7,7 @@ import { setBuildInfo } from "./build.ts";
|
|||
import { setVersions } from "./version.ts";
|
||||
import { setPrepareStackTrace } from "./error_stack.ts";
|
||||
import { Start, start as startOp } from "./ops/runtime.ts";
|
||||
import { handleTimerMacrotask } from "./web/timers.ts";
|
||||
|
||||
export let OPS_CACHE: { [name: string]: number };
|
||||
|
||||
|
@ -27,6 +28,7 @@ export function initOps(): void {
|
|||
for (const [name, opId] of Object.entries(OPS_CACHE)) {
|
||||
core.setAsyncHandler(opId, getAsyncHandler(name));
|
||||
}
|
||||
core.setMacrotaskCallback(handleTimerMacrotask);
|
||||
}
|
||||
|
||||
export function start(source?: string): Start {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue