public static async Task PrintStats(UserTrace t, CancellationToken token) { while (!token.IsCancellationRequested) { var stats = t.QueryStats(); Console.WriteLine($"Stats - Handled:{stats.EventsHandled}. Lost:{stats.EventsLost}"); await Task.Delay(5000, token); } }