Skip to main content
Home
This package has been archived, and as such it is read-only.

latest

Scheduling utilities for all runtimes.

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
58%
Published
2 years ago (0.1.3)
class FrameLoop

A class to manage requestAnimationFrame loops.

Properties

A map of callback names to an array of performance times in milliseconds.

The maximum time a frame is allowed to take in milliseconds before a warning is logged.

readonly
iterationMetrics: { high: number; low: number; avg: number; frametimes: number[]; }

Get the current iteration metrics for the frame loop.

The name of the frame loop.

onUpdate: (callback: (delta: number) => void) => () => void

Register a callback to be called on each frame.

once: (callback: (delta: number) => void) => void

Register a callback to be called once on the next frame.

Whether to print frame loop performance metrics to the console.

start: () => unknown

Start the frame loop.

The interval in milliseconds at which to log a summary of the frame loop performance.

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@build/scheduling

Import symbol

import { FrameLoop } from "@build/scheduling/frameloop";
or

Import directly with a jsr specifier

import { FrameLoop } from "jsr:@build/scheduling/frameloop";

Add Package

pnpm i jsr:@build/scheduling
or (using pnpm 10.8 or older)
pnpm dlx jsr add @build/scheduling

Import symbol

import { FrameLoop } from "@build/scheduling/frameloop";

Add Package

yarn add jsr:@build/scheduling
or (using Yarn 4.8 or older)
yarn dlx jsr add @build/scheduling

Import symbol

import { FrameLoop } from "@build/scheduling/frameloop";

Add Package

vlt install jsr:@build/scheduling

Import symbol

import { FrameLoop } from "@build/scheduling/frameloop";

Add Package

npx jsr add @build/scheduling

Import symbol

import { FrameLoop } from "@build/scheduling/frameloop";

Add Package

bunx jsr add @build/scheduling

Import symbol

import { FrameLoop } from "@build/scheduling/frameloop";