If you are loading many files, this may slow down your page load time.
To set a timeout, use file_get_context and then simplexml_load_string
<?php
$fp = fopen('http://www.example.com/rss', false, stream_create_context(array('http' => array('timeout', '1.5'))));
if ($fp) {
print_r( simplexml_load_string($fp) );
} else {
echo "The request timed out";
}
?>