Similar to PR #7401, replacing Thread.Sleep with Task.Delay throughout the codebase would improve the performance of PT Run as Thread.Sleep blocks the thread that it is called on whereas Task.Delay uses a timer instead and schedules a thread to resume work after the interval has passed. This does not block the thread.
Performance Improvement of PT Run
Similar to PR #7401, replacing
Thread.Sleep
withTask.Delay
throughout the codebase would improve the performance of PT Run asThread.Sleep
blocks the thread that it is called on whereasTask.Delay
uses a timer instead and schedules a thread to resume work after the interval has passed. This does not block the thread.