Abstracted setTimeout pattern.