PHP code example of epwt / xhprof
1. Go to this page and download the library: Download epwt/xhprof 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/ */
epwt / xhprof example snippets
public function registerBundles()
{
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
$bundles[] = new EPWT\XhprofBundle\EPWTXhprofBundle();
}
}
xhprofStart('Name of sample');
xhprofEnd();
for($a = 0; $a < 20; $a++) {
xhprofStart('Hello world');
for ($i = 0; $i < 20; $i ++) {
sleep(0.1);
}
xhprofEnd();
}