Factor sleep into func.