PHP code example of weiyongsheng / laravel-performance

1. Go to this page and download the library: Download weiyongsheng/laravel-performance 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/ */

    

weiyongsheng / laravel-performance example snippets


pf()->auto('search1');
#代码块
pf()->auto('search1');
var_dump(pf()->getBenchmarkTime());

##### or #####

pf()->start('search2');
#代码块
pf()->end('search2');
var_dump(pf()->getBenchmarkTime());

pf()->startRecordQueries();
#sql查询代码
$sql = pf()->getSql();
var_dump($sql);