What is difference between yield and sleep methods?

Solution

Yield method pauses the currently executing thread temporarily for giving a chance to remaining thread of same priority to execute whereas sleep causes currently executing thread to sleep for the specific nuber of m/s or n/s.

Share this thread

Comments

Comments
comments powered by Disqus

Navigation

Social Media