testing routine for letting a thread sleep for some time