Example #1
0
 public static function getAndParseXmlFromUrl($url)
 {
     $time_start = microtime(true);
     $get_start = microtime(true);
     $doc = HD::http_get_document($url);
     $get_end = microtime(true);
     $parse_start = microtime(true);
     $xml = HD::parse_xml_document($doc);
     $parse_end = microtime(true);
     $time_end = microtime(true);
     $time = $time_end - $time_start;
     $get_time = $get_end - $get_start;
     $parse_time = $parse_end - $parse_start;
     hd_print(__METHOD__ . ':' . " xml obtained in {$get_time} seconds and parsed in {$parse_time} seconds total ={$time}");
     return $xml;
 }