PHP code example of satmaelstorm / ts-profiler

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

    

satmaelstorm / ts-profiler example snippets


$profiler = ProfilerSingletone::getInstance();

$profiler = ProfilerSingletone::getInstance(false);

$profiler = new Profiler();

$profiler = new Profiler(false);

$tracker = $profiler->addTracker($name, $saver);

$tracker = $profiler->addTracker($name, $saver, false);

$tracker = $profiler->addTracker(
    'csvTracker',
    new \satmaelstorm\TSProfiler\TSProfilerShutdown\CSVSaver('\tmp'); 
                                );

$tracker->startJob('jobName');
//profiled code
$tracker->stopJob('jobName');