未验证 提交 14388e46 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #20743 from linbingquan/dev-clock

Clock: Clean up.
......@@ -14,7 +14,7 @@ class Clock {
start() {
this.startTime = ( typeof performance === 'undefined' ? Date : performance ).now(); // see #10732
this.startTime = now();
this.oldTime = this.startTime;
this.elapsedTime = 0;
......@@ -50,7 +50,7 @@ class Clock {
if ( this.running ) {
const newTime = ( typeof performance === 'undefined' ? Date : performance ).now();
const newTime = now();
diff = ( newTime - this.oldTime ) / 1000;
this.oldTime = newTime;
......@@ -65,4 +65,10 @@ class Clock {
}
function now() {
return ( typeof performance === 'undefined' ? Date : performance ).now(); // see #10732
}
export { Clock };
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册