How to do it...

  1. Create two folders called AsyncDestination and AsyncSource:
  1. To the AsyncSource folder, add a couple of large files to process:
  1. Create a new WinForms application and add a forms times control, a button, and a label called lblTimer to the form. Call the timer asyncTimer and set its Interval to 1000 milliseconds (1 second):
  1. In the code above the constructor, add the CancellationTokenSource object and the elapsedTime variable ...

Get C# 7 and .NET Core Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.