CURL not to wait for an answer?

There is a simple code:
$v1 = microtime(true);
$main = curl_init('');
curl_setopt($main, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($main, CURLOPT_USERAGENT, 'Opera/9.80');
curl_setopt($main, CURLOPT_FOLLOWLOCATION, 1);

$v2 = microtime(true);
echo $v2 - $v1.'<br>';
echo 'ok';

On the landing page at posted code:
echo 'target';

The first script is always waiting for when the second will work and respond, i.e., its running time is not less than 3 seconds.
How do I send curl request and wait for response and immediately show OK in the first script?
June 7th 19 at 14:50
2 answers
June 7th 19 at 14:52
June 7th 19 at 14:54
Or as said SagePtr set CURLOPT_TIMEOUT_MS

Find more questions by tags PHP