I know one difference:
If we say thread.sleep(1000), that thread will sleep for 1000 milliseconds for sure, whereas with yield()
thread.sleep(1000)
1000
yield()
yield merely says: now is a good time to let another thread run and is a hint to the scheduler. sleep really does that: sleep at least the given time.
yield
sleep