Quality is delighting customers
setSpeed wait for the specified time before every selenium operation takes place. But one sleep() will set up wait only for once.
Refer below URL : https://www.quora.com/What-is-the-difference-between-setSpeed-and-s...
Thred.sleep : This will help in resolving sync issues with the objects taking time to load when we use in a for loop waiting for an object. Once the objects is loaded, even though the the max wait time u have given is not reached, ur script will skip the loop and continue with next thereby reducing the script execution time.
setSpeed : Assume u hv given 5000 ms in setspeed, ur script will halt for 5sec after performing every action(command) even when the object is loaded properly. This will increase ur script execution time. The less Selenium.setspeed time given the better.