user1615362 user1615362 - 1 year ago 150
C# Question

How to pause task execution

I have this code that creates a task:

Task.Factory.StartNew(() =>

Sometimes I need to pause for few seconds inside

Is it OK to use the regular
? Or is there another way to pause the running task?

Answer Source

I believe it is fine to do this but preferable to use TaskCreationOptions.LongRunning.

Task.Factory.StartNew(() =>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download