agstopwatch

AGStopwatch is built using TypeScript. It's just a basic stopwatch - you can start it, stop it, restart it, and check how much time has elapsed.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
agstopwatch
1.1.09 years ago9 years agoMinified + gzip package size for agstopwatch in KB

Readme

AGStopwatch
AGStopwatch is built using TypeScript. It's just a basic stopwatch - you can start it, stop it, restart it, and check how much time has elapsed. Install using: ``` npm install agstopwatch ``` Use it in your code using: Typescript: ```ts import Stopwatch = require("agstopwatch"); ``` JavaScript: ```js var Stopwatch = require("agstopwatch"); ```

Usage

Stopwatch

This is a constructor function. You MUST call it with the new keyword: ```js var sw = new Stopwatch(); ```

Stopwatch.start()

Starts the stopwatch.

Stopwatch.stop()

Stops the stopwatch.

Stopwatch.restart()

Resets the stopwatch.

Stopwatch.startTime

The time the stopwatch was started (in ms).

Stopwatch.stopTime

The time the stopwatch was stopped (in ms).

Stopwatch.elapsed

The time elapsed (in ms).