Skip to content

TickMeter

Core and matricesclassOpenCV 5.0.0
import { TickMeter } from '@banou/opencv-wasm'

Use after await initOpenCV(). See the initialization and named imports guide.

ARGUMENTSConstructor or factory
CLASSTickMeter
RETURN TYPEOwned native handle
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Native object: release it with using or delete(). Factories can return null; check before calling methods.

a Class to measure passing time.

The class computes passing time by counting the number of ticks per second. That is, the following code computes the execution time in seconds:

It is also possible to compute the average time over multiple runs:

See: getTickCount, getTickFrequency

Constructors and members

static new

the default constructor

new(): TickMeter;
Returns

The TickMeter result.

clone

Create another handle to the same native object. This retains the object without copying its pixels or algorithm state; dispose both handles separately.

clone(): this;
Returns

The this result.

start

starts counting ticks.

start(): void;

stop

stops counting ticks.

stop(): void;

getTimeTicks

returns counted ticks.

getTimeTicks(): bigint;
Returns

The bigint result.

getTimeMicro

returns passed time in microseconds.

getTimeMicro(): number;
Returns

The number result.

getTimeMilli

returns passed time in milliseconds.

getTimeMilli(): number;
Returns

The number result.

getTimeSec

returns passed time in seconds.

getTimeSec(): number;
Returns

The number result.

getLastTimeTicks

returns counted ticks of the last iteration.

getLastTimeTicks(): bigint;
Returns

The bigint result.

getLastTimeMicro

returns passed time of the last iteration in microseconds.

getLastTimeMicro(): number;
Returns

The number result.

getLastTimeMilli

returns passed time of the last iteration in milliseconds.

getLastTimeMilli(): number;
Returns

The number result.

getLastTimeSec

returns passed time of the last iteration in seconds.

getLastTimeSec(): number;
Returns

The number result.

getCounter

returns internal counter value.

getCounter(): bigint;
Returns

The bigint result.

getFPS

returns average FPS (frames per second) value.

getFPS(): number;
Returns

The number result.

getAvgTimeSec

returns average time in seconds

getAvgTimeSec(): number;
Returns

The number result.

getAvgTimeMilli

returns average time in milliseconds

getAvgTimeMilli(): number;
Returns

The number result.

reset

resets internal values.

reset(): void;

These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.