Ejemplo n.º 1
0
        async static Task p606_FooAsync(MyCancellationToken cancellationToken)
        {
            Thread.Sleep(200); // Chj: to tear apart 1000ms boundary

            for (int i = 0; i < 10; i++)
            {
                Console.WriteLine(i);
                await Task.Delay(1000);

                cancellationToken.ThrowIfCancellationRequested();
            }
        }