For functions there is a built-in way to do this: /schedule function