Implement a rudimentary sleep function