New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

minimal-timer

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

minimal-timer

Minimal time tracker.

latest
Source
npmnpm
Version
4.1.0
Version published
Maintainers
1
Created
Source

minimal-timer

Keeps track of the elapsed time in miliseconds.

Build Status npm version JavaScript Style Guide

Install

$ npm install minimal-timer --save

Usage

const delay = require('delay')
const timer = require('minimal-timer')

const time = timer() // instantiates the timer

time.start()

await delay(500)

console.log(time.elapsedTime()) // => 500 +- 

time.stop()

await delay(500)

console.log(time.elapsedTime()) // => 500 +- 

time.resume()

await delay(500)

console.log(time.elapsedTime()) // => 1000 +- 

API

timer() object

Creates a new instance

start(customStartDate[optional]) void

Starts/Restart the timer

customStartDate Date [optional]

resume() void

Resumes the timer.

stop() number

Stops the timer

Returns the elapsed time in miliseconds

elapsedTime() number

Returns the elapased between the start time and the current time in miliseconds

isRunning() boolean

Returns true if the timer is running otherwise false

License

MIT © Alvaro Bernal

Keywords

timer

FAQs

Package last updated on 07 Jul 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts