How to do it...

  1. PerfTips are enabled by default. But just in case you are not seeing any PerfTips, go to Tools | Options, and expand the Debugging node. Under General, to the bottom of the settings page, you will see an option called Show elapsed time PerfTip while debugging. Ensure that this option is checked:
  1. We will create a few simple methods that mimic long-running tasks. To do this, we will just sleep the thread for a couple of seconds. In the Recipes.cs file, add the following code:
        public static void RunFastTask()         {           RunLongerTask();         }         private static void RunLongerTask()         {           Thread.Sleep(3000);           BottleNeck();         }  private static ...

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.