| 224 | * costs. |
| 225 | */ |
| 226 | export class TimeKeeper { |
| 227 | private _clock:Function; |
| 228 | private _lastTime:number; |
| 229 | |
| 230 | constructor(clock:Function = () => Date.now()) { |
| 231 | this._clock = clock; |
| 232 | this.reset(); |
| 233 | } |
| 234 | |
| 235 | get elapsed():number { |
| 236 | return this._clock() - this._lastTime; |
| 237 | } |
| 238 | |
| 239 | public reset():void { |
| 240 | this._lastTime = this._clock(); |
| 241 | } |
| 242 | } |
| 243 | |
| 244 | /** Timer Related Items**/ |
| 245 |
nothing calls this directly
no outgoing calls
no test coverage detected