Mega Code Archive

 
Categories / Php / Code Snippets
 

Get the connection time with PHP and cURL

<?php //google $curl = curl_init('http://www.google.com/'); curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE); curl_exec($curl); //get the connection time print("Connection time: " . curl_getinfo($curl, CURLINFO_CONNECT_TIME) .'<br>'); ?>