PHP asynchronous processing

Time:2020-10-14

a.php

\n";
		} else {
		$out = "GET " . $url . " / HTTP/1.1\r\n";
		$out .= "Host: " . $domain . "\r\n";
		$out .= "Connection: Close\r\n\r\n";
		fwrite($fp, $out);
		/*Ignore execution results
		while (!feof($fp)) {
		echo fgets($fp, 128);
		}*/
		fclose($fp);
		}
		}

		fsockopen_get('temp.com', '/b.php');
		$end = microtime(true);
		$time= $end - $start;
		//It can be adjusted to ten decimal places
		echo number_format($time, 10, '.', '')." seconds";

b.php


		<?php header("Content-type: text/html; charset=utf-8");
		file_put_contents('54321.log', microtime(true), FILE_APPEND);
		sleep(20);
		file_put_contents('54321.log', microtime(true), FILE_APPEND);