[LayaAirIDE 1.0]Laya.timer.once计时不准确的问题
import WebGL = Laya.WebGL;
// 程序入口
class GameMain{
constructor()
{
Laya.init(600,400, WebGL);
console.log("Before In One, Time = " + Date.now());
Laya.timer.once(1,this,this.One)
console.log("After In One, Time = " + Date.now());
}
One():void{
console.log("In One, Time = " + Date.now());
}
}
new GameMain();
控制台结果如下
Before In One, Time = 1566892472532
After In One, Time = 1566892472532
In One, Time = 1566892472538
// 程序入口
class GameMain{
constructor()
{
Laya.init(600,400, WebGL);
console.log("Before In One, Time = " + Date.now());
Laya.timer.once(1,this,this.One)
console.log("After In One, Time = " + Date.now());
}
One():void{
console.log("In One, Time = " + Date.now());
}
}
new GameMain();
控制台结果如下
Before In One, Time = 1566892472532
After In One, Time = 1566892472532
In One, Time = 1566892472538
没有找到相关结果
已邀请:
要回复问题请先登录
2 个回复
CloudFlame
赞同来自:
CloudFlame
赞同来自: