I have this code that creates a task:
Task.Factory.StartNew(() =>
{
ExtractStuff(fileName);
});
Sometimes I need to pause for few seconds inside ExtractStuff
Is it OK to use the regular Thread.Sleep(1000)? Or is there another way to pause the running task?
I believe it is fine to do this but preferable to use TaskCreationOptions.LongRunning.