Skip to content

Commit 45171cd

Browse files
committed
Add total transaction time CURLINFO_TOTAL_TIME
Add total transaction time as $curl->totalTime (CURLINFO_TOTAL_TIME)
2 parents 1e10006 + 2fa41a2 commit 45171cd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Curl/Curl.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ class Curl
5656
public $httpStatusCode = 0;
5757
public $httpErrorMessage = null;
5858

59+
public $totalTime = 0;
5960
public $baseUrl = null;
6061
public $url = null;
6162
public $effectiveUrl = null;
@@ -347,6 +348,7 @@ public function exec($ch = null)
347348
$this->curlErrorMessage = curl_error($this->curl);
348349
$this->curlError = !($this->curlErrorCode === 0);
349350
$this->httpStatusCode = curl_getinfo($this->curl, CURLINFO_HTTP_CODE);
351+
$this->totalTime = curl_getinfo($this->curl, CURLINFO_TOTAL_TIME);
350352
$this->httpError = in_array(floor($this->httpStatusCode / 100), array(4, 5));
351353
$this->error = $this->curlError || $this->httpError;
352354
$this->errorCode = $this->error ? ($this->curlError ? $this->curlErrorCode : $this->httpStatusCode) : 0;

0 commit comments

Comments
 (0)