Jose Ramon
Jose Ramon

Reputation: 5444

Pause/resume a thread instead of start/stoping in c#

I have created a unity project. In the Start() method I have created a thread = new Thread(new ThreadStart(zip)); a new thread of my method zip. In stop_rec() method I am starting the thread.

void stop_recording(){
    .... 
    thread.Start ();

}

This method it is called 3-4 times. Therefore the thread it is starting and stoping three-four times. Is there a way to pause/resume the thread instead of start stop it?

Upvotes: 0

Views: 122

Answers (1)

joko
joko

Reputation: 182

Use Thread.Sleep(Your_Pause_Duration);

Upvotes: 2

Related Questions