If you wan't your result to be saved after the time limit, you will need to add this to your code.
<?php
function shutdown()
{
global $ann;
fann_save($ann, dirname(__FILE__) . "/result.net");
fann_destroy($ann);
}
register_shutdown_function('shutdown');
?>
where $ann is your neural network var and 'result.net' your neural network config file.