Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

TEST

// Scheduled Action Hook
function cron( ) {
	echo 'it's work';
}

// Custom Cron Recurrences
function invoice_cron_recurrence( $schedules ) {
	$schedules['my_interval'] = array(
		'display' => __( 'Good', 'textdomain' ),
		'interval' => 333,
	);
	return $schedules;
}
add_filter( 'cron_schedules', 'invoice_cron_recurrence' );

// Schedule Cron Job Event
function invoice_cron() {
	if ( ! wp_next_scheduled( 'cron' ) ) {
		wp_schedule_event( time(), 'my_interval', 'cron' );
	}
}
add_action( 'wp', 'invoice_cron' );