I don't know different Thread.Sleep() and Task.Wait().
public void Start ()
{
mytask = new Task( ()=> { this.Proccess(); });
mytask.Start();
}
private void Process()
{
while(true)
{
if( blahblah )
{ process.. }
else
{
Thread.Sleep((int)1000/30); // name is "A".
// mytask.Wait( (int)1000/30 ); // name is "B".
}
}
}
I was using the C++ Language. Then I used the Sleep() for Thread Context switch.
"A" code is cpu usage is low. "B" code is cpu usage is low.
So "A" and "B" is doing context switch.
What the there different? What I using the code?