Skip to content

PhaseTimes beta ​

Class of @v12-engine/client

ts
export declare class PhaseTimes

How long each phase of the frame takes, with a pair of clock reads around it (stamp, lap), and the frames that hitched: the šŸ“Š window's and the editor's Metrics. Off, a read is the test of a flag and nothing is kept; on, a lap is a clock read and an array write, and a frame makes nothing anew once its phases have been seen

Members ​

constructor ​

ts
constructor(now?: () => number);

Constructs a new instance of the PhaseTimes class

clear ​

ts
clear(): void;

Forgets the frames and the log: measuring starts over

enabled ​

ts
enabled: boolean;

Whether the phases are timed: on while someone looks (PerfStats.enabled)

frame ​

ts
frame(): void;

A frame begins: the one before it is done, with the time it took from its start to this one's

lap ​

ts
lap(name: string, since: number, of?: string): number;

Adds the time since since to the phase name (a part of the phase of, if it is), and gives back the clock, to chain the next lap from: t = times.lap('fog', t, 'world'). Nothing while nobody looks

sample ​

ts
sample(): {
        phases: PhaseSample[];
        hitches: Hitch[];
    };

Each phase's time a frame over the last second, a phase followed by its parts, and the hitches, the latest last

stamp ​

ts
stamp(): number;

The clock, for a lap to be taken from: 0 while nobody looks