Initializes a new instance of the Timer class, optionally passing a configuration object as parameter.
An object with the options to configure the timer execution and output.
Gets the time span with the elapsed time so far.
Gets a value representing the end time, in nanoseconds.
Gets whether or not the time counting has ended.
Gets the output options object used by this timer.
Gets the result time span object from the time counting.
Gets a value representing the start time, in nanoseconds.
Gets whether or not the time counting has started.
Finishes the time counting, adjusting the time values and properties accordingly.
An object with the time span between start and end.
Protected setter for the endTime property.
Protected setter for the result property.
Protected setter for the startTime property.
Starts the time counting.
Generated using TypeDoc
Represents a simle time counting object, that is able to determine temporal differences between start and end.
For a more complete implementation, see Timer.
Timing an operation
import {SimpleTimer} from "timecount"; const timer = new SimpleTimer({ autoStart: true }); // Operation code... timer.end(); console.log(`It took ${timer.result.toString()} to do it.`);