PHP code example of initphp / performance-meter
1. Go to this page and download the library: Download initphp/performance-meter 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/ */
initphp / performance-meter example snippets
use InitPHP\PerformanceMeter\PerformanceMeter;
PerformanceMeter::setPointer('main');
for($i = 0; $i <= 1000; $i++){
usleep(10);
}
PerformanceMeter::setPointer('mainEnd');
echo PerformanceMeter::elapsedTime('main', 'mainEnd', 3) . ' seconds passed ';
echo PerformanceMeter::memoryUsage('main', 'mainend', 2) . ' memory used.';
// Output : "15.204 seconds passed 0.77KB memory used."