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