Documentation Home
This page describes a pre-release version of Jasmine (5.0.0-beta.0). There may be additional changes, including breaking changes, before the final 5.0.0 release.
The current stable version of Jasmine is 5.5.

Class: Timer

Timer()

Tracks elapsed time

Constructor

new Timer()

Example
const timer = new jasmine.Timer();
timer.start();
const elapsed = timer.elapsed()

Methods

elapsed() → {number}

Determines the time since the timer was started.

Returns:

Elapsed time in milliseconds, or NaN if the timer has not been started

Type
number

start()

Starts the timer.