Skip to content

Commit

Permalink
Merge pull request mrdoob#10732 from WhitestormJS/dev
Browse files Browse the repository at this point in the history
Add Clock support in node
  • Loading branch information
mrdoob authored Feb 17, 2017
2 parents 98788fb + 3f68e22 commit 8e4507d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/Clock.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Object.assign( Clock.prototype, {

start: function () {

this.startTime = ( performance || Date ).now();
this.startTime = ( typeof performance === 'undefined' ? Date : performance ).now(); // see #10732

this.oldTime = this.startTime;
this.elapsedTime = 0;
Expand Down Expand Up @@ -52,7 +52,7 @@ Object.assign( Clock.prototype, {

if ( this.running ) {

var newTime = ( performance || Date ).now();
var newTime = ( typeof performance === 'undefined' ? Date : performance ).now();

diff = ( newTime - this.oldTime ) / 1000;
this.oldTime = newTime;
Expand Down

0 comments on commit 8e4507d

Please sign in to comment.