log frame times
This commit is contained in:
parent
41fb0927f1
commit
a2ae6d273e
5 changed files with 63 additions and 10 deletions
|
@ -33,20 +33,19 @@ internal sealed class GameTickWorker(
|
|||
|
||||
private async Task RunAsync()
|
||||
{
|
||||
// do not block in StartAsync
|
||||
await Task.Delay(1).ConfigureAwait(false);
|
||||
|
||||
try
|
||||
{
|
||||
var sw = new Stopwatch();
|
||||
while (!_cancellation.IsCancellationRequested)
|
||||
{
|
||||
logger.LogTrace("since last frame: {}", sw.Elapsed);
|
||||
|
||||
var delta = sw.Elapsed;
|
||||
sw.Restart();
|
||||
|
||||
foreach (var step in _steps)
|
||||
await step.TickAsync(delta);
|
||||
|
||||
await Task.Delay(1);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue