php - How to get the delay ms of the website
仅有的幸福
仅有的幸福 2017-05-16 12:57:55
0
1
436

I have never seen this before. The boss suddenly said that he would add a delay speed of ms to display the website on the page. I haven't found any useful information after Baidu for a long time. I would like to ask some experts to tell me how to achieve it.

仅有的幸福
仅有的幸福

reply all(1)
phpcn_u1582
if (strcasecmp(PHP_OS, 'WINNT') === 0) {
    // Windows 服务器下
    $pingresult = exec("ping -n 1 {$address}", $outcome, $status);
} elseif (strcasecmp(PHP_OS, 'Linux') === 0) {
    // Linux 服务器下
    $pingresult = exec("ping -c 1 {$address}", $outcome, $status);
}  
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template