Reputation: 385
I'm not sure how this will work, I create a Thread object t1
and associate a method DoStuff
, inside DoStuff
I need to at some point call Thread.Sleep(1000);
will this pause t1
or the main thread or both.
var t1 = new Thread(new ThreadStart(DoStuff));
t1.Start();
public void DoStuff()
{
//some code then
Thread.Sleep(1000);
}
Upvotes: 1
Views: 494
Reputation: 9780
It will pause the t1
thread for sure, but why don't just test it out yourself?
Upvotes: 1