$timeout = 0.3; // ... curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT_MS, $timeout * 1000 ); curl_setopt( $ch, CURLOPT_TIMEOUT_MS, $timeout * 1000 );