Permalink
Browse files

Update stopwatch.js

  • Loading branch information...
garris committed Nov 2, 2015
1 parent c26e666 commit 634be63c1dcc97b5f47a088e2e89ad64b4524dbf
Showing with 3 additions and 0 deletions.
  1. +3 −0 test/stopwatch.js
View
@@ -6,6 +6,7 @@ function stopwatch(label, resolution) {
label = '';
}
this.label = label;
this.isRunning = false;
this.lastLapTime = 0.0;
this.startTime = 0.0;
this.stopTime = 0.0;
@@ -48,9 +49,11 @@ function stopwatch(label, resolution) {
if (toConsole) {
console.log(label + ' ' + this.selfTime + "ms")
}
this.isRunning = false;
return this.selfTime;
};
this.start = () => {
this.isRunning = true;
this.startTime = this.getTime();
};
this.start();

0 comments on commit 634be63

Please sign in to comment.