TickMeter
import { TickMeter } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
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;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;The this result.
start
starts counting ticks.
start(): void;stop
stops counting ticks.
stop(): void;getTimeTicks
returns counted ticks.
getTimeTicks(): bigint;The bigint result.
getTimeMicro
returns passed time in microseconds.
getTimeMicro(): number;The number result.
getTimeMilli
returns passed time in milliseconds.
getTimeMilli(): number;The number result.
getTimeSec
returns passed time in seconds.
getTimeSec(): number;The number result.
getLastTimeTicks
returns counted ticks of the last iteration.
getLastTimeTicks(): bigint;The bigint result.
getLastTimeMicro
returns passed time of the last iteration in microseconds.
getLastTimeMicro(): number;The number result.
getLastTimeMilli
returns passed time of the last iteration in milliseconds.
getLastTimeMilli(): number;The number result.
getLastTimeSec
returns passed time of the last iteration in seconds.
getLastTimeSec(): number;The number result.
getCounter
returns internal counter value.
getCounter(): bigint;The bigint result.
getFPS
returns average FPS (frames per second) value.
getFPS(): number;The number result.
getAvgTimeSec
returns average time in seconds
getAvgTimeSec(): number;The number result.
getAvgTimeMilli
returns average time in milliseconds
getAvgTimeMilli(): number;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.