It checks how long it's been since the last time cron.php was run and runs it if it was longer than an hour ago. To change how often it runs change the 3600 to however seconds you want between each run.
It also dumps the output from the cron.php run into cron.time in your moodle data directory so you can check it.
Hope it's of use to someone.
if(file_exists($CFG->dataroot."/cron.time") && time()-filemtime($CFG->dataroot."/cron.time")>3600){
$ch = curl_init($CFG->wwwroot."/admin/cron.php");
$fp = fopen($CFG->dataroot."/cron.time", "w");
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
fclose($fp);
}
?>