PHP code example of slavawins / laravel-profiler-deep

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

    

slavawins / laravel-profiler-deep example snippets

  
ProfilerDeepFacade::AddPart("header");
//yor slow shid code

ProfilerDeepFacade::AddPart("firstpart");
//yor slow shid code

ProfilerDeepFacade::AddPart("Part code 3");
//yor slow shid code

ProfilerDeepFacade::Stop();
dump(ProfilerDeepFacade::ResultParts());

+--------------------------------------------------------------------+
|    Time CPU    |    Time SQL     |            Part name            |
+--------------------------------------------------------------------+
|    0.03 sec.   |   0.0044 sec.   |   header  EmitTestCommand:53    |
|    0.01 sec.   |   0.0025 sec.   |  firstpart  EmitTestCommand:59  |
|    0.01 sec.   |   0.0053 sec.   | Part code 3 EmitTestCommand:120 |
+--------------------------------------------------------------------+

  
ProfilerDeepFacade::AddPart("header");
//yor slow shid code
ProfilerDeepFacade::Stop();

//yor slow shid code

ProfilerDeepFacade::AddPart("firstpart");
//yor slow shid code

ProfilerDeepFacade::AddPart("Part code 3");
//yor slow shid code
ProfilerDeepFacade::Stop();

//yor slow shid code
ProfilerDeepFacade::Stop();
dump(ProfilerDeepFacade::ResultParts());