Page 133 - CSharp/C#
P. 133

// Do other work
         }

         public void MethodC()
         {
              Thread.Sleep(100);
         }


        The primary purpose of async/await is to allow the machine to do additional work - for example, to
        allow the calling thread to do other work while it's waiting for a result from some I/O operation. In
        this case, the calling thread is never allowed to do more work than it would have been able to do
        otherwise, so there's no performance gain over simply calling MethodA(), MethodB(), and MethodC()
        synchronously.

        Read Async-Await online: https://riptutorial.com/csharp/topic/48/async-await





































































        https://riptutorial.com/                                                                               79
   128   129   130   131   132   133   134   135   136   137   138