<?php
ignore_user_abort ( true );
set_time_limit ( 0 );function write_txt() {
if (! file_exists ( "test.txt" )) {
$fp = fopen ( "test.txt", "wb" );
fclose ( $fp );
}
$str = file_get_contents ( "test.txt" );$str .= "\r\n".date("H:i:s");
$fp = fopen ( "test.txt", "wb" );
fwrite ( $fp, $str );
fclose ( $fp );
}
function do_cron() {
usleep ( 2000000 );
write_txt ();
}
while ( 1 ) {
do_cron ();
}
?>