Cron execution may differ depending on when the system cron is actually being run. For example, if your system is running cron at 5 minutes interval, even a cron scheduled for immediate run will execute between a few seconds to 5 minutes.
You may use the WP Crontrol Plugin to check the cron schedules set by WordPress in case other cron tasks are affecting it. To check system cron schedules, use crontab
command or check cron settings from CPanel
.
Also, if you don’t have define('DISABLE_WP_CRON', true);
set in wp-config.php
, and there is no Operating System cron running, that means WordPress is running the crons. In that case cron event execution will depend on site visits. However, from your following description:
the function actually running varies between a few seconds and 5 minutes.
it looks like an Operating System cron is running at 5 minutes interval. You may make it one minute interval to get faster execution.