To task not thread

This commit is contained in:
CortexCore 2025-07-04 06:25:34 +08:00
parent 7db625419c
commit c9f4f6cf98
1 changed files with 5 additions and 3 deletions

View File

@ -67,7 +67,7 @@ new Thread(Tick).Start();
await app.RunAsync();
return;
void Tick()
async void Tick()
{
app.Services.QueryComponents(out ILogger<INetServer> logger);
while (true)
@ -81,7 +81,9 @@ void Tick()
logger.LogCritical(exception,exception.Message);
}
Thread.Sleep(16);
//logger.LogInformation("wait next frame");
await Task.Delay(16);
}
logger.LogCritical("程序已退出,不应该出现");
}