Home > @rushstack/operation-graph > Stopwatch
Stopwatch class
Represents a typical timer/stopwatch which keeps track of elapsed time in between two events.
Signature:
export declare class Stopwatch
Constructors
Constructor | Modifiers | Description |
|---|---|---|
Constructs a new instance of the |
Properties
Property | Modifiers | Type | Description |
|---|---|---|---|
| number | Get the duration in seconds. | |
| number | undefined | Return the end time of the most recent stopwatch run. | |
| boolean | ||
| number | undefined | Return the start time of the most recent stopwatch run. |
Methods
Method | Modifiers | Description |
|---|---|---|
Resets all values of the stopwatch back to the original | ||
Starts the stopwatch. Note that if end() has been called, reset() should be called before calling start() again. | ||
| Static helper function which creates a stopwatch which is immediately started | |
Stops executing the stopwatch and saves the current timestamp | ||
Displays how long the stopwatch has been executing in a human readable format. |