Added sleep to reduce CPU usage from 100% to 0% in tests.