jrn2477
9/5/2018 - 9:39 PM

Stopwatch Timing Function

public Example
{
  public static void main(string[] args)
  {
    execute(); 
  }
  
  public async Task<string> execute()
  {
    // create a stop watch to record how long this was running
    var watch = System.Diagnostics.Stopwatch.StartNew(); 
    
    // execute a long running task 
    await SampleLongRunningTask(); 
    
    // stop the stopwatch 
    watch.Stop(); 
    
    // capture the amount of time run in milliseconds 
    double timeRun = watch.ElapsedMilliSeconds; 
  }
  
  public void SampleLongRunningTask()
  {
      
  }
}