1.0.0 • Published 2 years ago

js-stopwatch-timer v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

js-stopwatch-timer

A simple stopwatch/timer module created with pure vanilla JavaScript without any external dependencies.


Usage

How to install and use in a project

  1. Download the repo
  2. Copy file src/timer.js in to your project directory
  3. Import the module and create an instance of Timer

    import Timer from 'timer.js'
    const timer = new Timer()
    
    timer.start()
----

## Methods
```js
timer.start()

Starts counting upwards from 0.


timer.stop()

Stops the timer.


timer.reset()

Stops the timer and resets the time.


timer.countdown(seconds)

Starts a countdown of seconds depending on user input.


timer.lap()

Returns the time that has passed in an object.


timer.log()

Logs current time.


Versions

1.0.0

  • 1.0.0 was released 2022-09-26