This is really just implementing a setTimeout under the hood.