Class for timing the duration of things
Author: Jimmy Doughten https://github.com/dough10
- modules/Timer
- ~Timer
- new Timer(title)
- .end() ⇒
Array
- .endString() ⇒
String
- ~Timer
Kind: inner class of modules/Timer
- ~Timer
- new Timer(title)
- .end() ⇒
Array
- .endString() ⇒
String
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');
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']
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'