Skip to content

Latest commit

 

History

History
executable file
·
67 lines (53 loc) · 2.26 KB

Timer-doc.md

File metadata and controls

executable file
·
67 lines (53 loc) · 2.26 KB

modules/Timer

Class for timing the duration of things

Author: Jimmy Doughten https://github.com/dough10

modules/Timer~Timer

Kind: inner class of modules/Timer

new Timer(title)

Returns: Void - nothing

Param Type Description
title String name of the timer optional

Example (Example usage of Timer Class.)

let Timer = require('modules/Timer/Timer);
let t = new Timer('thing');

timer.end() ⇒ Array

ends the timer

Kind: instance method of Timer
Returns: Array - [0]hours, [1]mins, [2]seconds, [3]title/name
Example (Example usage of end() function.)

let Timer = require('modules/Timer/Timer);
let t = new Timer('thing');
// do stuff you want to see how long it will take
console.log(t.end());
// returns [0, 10, 15.347, 'thing']

timer.endString() ⇒ String

calls the end() method and formats into readable form

Kind: instance method of Timer
Returns: String - timer output
Example (Example usage of endString() Function.)

let Timer = require('modules/Timer/Timer);
let t = new Timer('thing');
// do stuff you want to see how long it will take
console.log(t.endString());
// returns 'thing - 0 hours 10 minutes 15.347 seconds'