https://github.com/initphp/performancemeter
A helpful library that allows you to measure and compare the runtime of the code you write with PHP.
https://github.com/initphp/performancemeter
performance-test performance-testing php
Last synced: about 2 months ago
JSON representation
A helpful library that allows you to measure and compare the runtime of the code you write with PHP.
- Host: GitHub
- URL: https://github.com/initphp/performancemeter
- Owner: InitPHP
- License: mit
- Created: 2022-03-15T09:40:53.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-07-28T05:54:24.000Z (almost 3 years ago)
- Last Synced: 2025-01-26T03:13:47.215Z (4 months ago)
- Topics: performance-test, performance-testing, php
- Language: PHP
- Homepage:
- Size: 6.84 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PerformanceMeter
A helpful library that allows you to measure and compare the runtime of the code you write with PHP.
[](https://packagist.org/packages/initphp/performancemeter) [](https://packagist.org/packages/initphp/performancemeter) [](https://packagist.org/packages/initphp/performancemeter) [](https://packagist.org/packages/initphp/performancemeter) [](https://packagist.org/packages/initphp/performancemeter)
## Installation
```
composer require initphp/performance-meter
```This is a library consisting of a single file and a single class. You can choose to manually include the `src/PerformanceMeter.php` file in the project. However, I recommend Composer to manage patches and updates more easily.
## Usage
```php
require_once "../vendor/autoload.php";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."
```## Credits
- [Muhammet ŞAFAK](https://www.muhammetsafak.com.tr) <>
## License
Copyright © 2022 [MIT License](./LICENSE)