Reference · The realistic Earth's pure parts
frameCapfunction
The frame rate cap for this device: maxFps (30 by default), lower on a small device.
Import it
import { frameCap } from "@johnmorrisdotca/chikyu-earth/realistic";
Definition
function frameCap(maxFps?: number, device?: { deviceMemory?: number; hardwareConcurrency?: number; }): number
Parameters
| Name | Type | Description |
|---|---|---|
maxFps (optional) | number | The most frames a second to allow. |
device (optional) | { deviceMemory?: number; hardwareConcurrency?: number; } |
|
Returns
number
The frames a second to allow, at least 1; 20 at most on a small device.
Examples
import { frameCap } from "@johnmorrisdotca/chikyu-earth/realistic";
console.log(frameCap(), frameCap(30, { deviceMemory: 1 }));30 20What it prints (run when this page was built)