This function is supposed to be synchronous. The second function below, with the `setTimeout`, is the async one that determines how often to call this function.