Documentation Home
This page is for an older version of Jasmine (5.2).
The current stable version of Jasmine is: 5.4. You can also look at the docs for the next release: Edge

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.