PHP code example of mengshaoying / timer

1. Go to this page and download the library: Download mengshaoying/timer library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mengshaoying / timer example snippets


$t0 = new Timer\Timer();
for ($i = 0; $i < 10000000; $i++) {
    $x = mt_rand();
}
$t1 = new Timer\Timer();
// 输出时间差,t1 - t0
echo $t1->sub($t0);
echo PHP_EOL;