To task not thread
This commit is contained in:
parent
7db625419c
commit
c9f4f6cf98
|
@ -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("程序已退出,不应该出现");
|
||||
}
|
Loading…
Reference in New Issue