From e7be64a2f928fe308e6bccbaf2059945b4c95dca Mon Sep 17 00:00:00 2001 From: walker Date: Mon, 9 Oct 2023 15:03:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=A8=E9=94=80=E8=80=97=E6=97=B6=E8=AE=A1?= =?UTF-8?q?=E7=AE=97=E6=97=A5=E5=BF=97=E6=89=93=E5=8D=B0=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9EntityId=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- world.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/world.go b/world.go index 7df1c3d..75afe48 100644 --- a/world.go +++ b/world.go @@ -13,7 +13,7 @@ import ( type WorldState int -type WorldId int +type WorldId = donburi.WorldId const ( Init WorldState = iota @@ -179,7 +179,6 @@ func (w *world) executeTodos() { } func (w *world) run() { for { - start := time.Now() select { case <-w.quit: // 退出信号 // 仿真退出,更新状态 @@ -196,6 +195,7 @@ func (w *world) run() { return } <-w.ticker.C + // start := time.Now() if w.state == Pause { // 暂停不更新 continue } @@ -214,7 +214,7 @@ func (w *world) run() { } else { w.times += w.speed } - dt := time.Since(start) - fmt.Println("仿真执行耗时:", dt.Milliseconds(), "ms") + // dt := time.Since(start) + // fmt.Println("仿真系统执行耗时:", dt.Milliseconds(), "ms") } }