Because I'm tired of writing these 5 lines of code over and over.
TypeScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test
AGStopwatch.d.ts
README.md
agstopwatch.ts Added a reset function, changed start/stop logic to make more sense b… Jul 15, 2013
package.json

README.md

#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:

import Stopwatch = require("agstopwatch");

JavaScript:

var Stopwatch = require("agstopwatch");

##Usage ###Stopwatch This is a constructor function. You MUST call it with the new keyword:

var sw = new Stopwatch();

###Stopwatch.start() Starts the stopwatch.

###Stopwatch.stop() Stops the stopwatch.

###Stopwatch.restart() Clears current start time and restarts the stopwatch.

###Stopwatch.reset() Clears current start and end time and stops 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).

##Stopwatch.running Returns true if the stopwatch is running.