What is difference between yielding and sleeping?



What is difference between yielding and sleeping?..

Answer / Rupendra Bahadur Singh

In C#, `yield` is a keyword used in generators to return a sequence of values one at a time, while `Thread.Sleep()` is a method that suspends the execution of the current thread for a specified amount of time.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Sharp Interview Questions

Which controls do not have events?

1 Answers  


What is an extension method in c#?

1 Answers  


Can var be null c#?

1 Answers  


What is collection of classes in c#?

1 Answers  


How many root nodes are there in an xml document?

1 Answers  


Is c# pass by value?

1 Answers  


What are handlers in c#?

1 Answers  


Can a private virtual method can be overridden?

1 Answers  


what is the purpose of interface in c#.net

6 Answers  


What is use of abstract class in c#?

1 Answers  


How do I do implement a trace?

1 Answers  


Where do you add an event handler ?

1 Answers  


Categories