bogkov/execution-speed

此组件提供计算执行速度的功能

1.0.0 2017-08-19 21:32 UTC

This package is not auto-updated.

Last update: 2024-09-29 02:39:25 UTC


README

GitHub license Latest Stable Version Minimum PHP Version Build Status codecov Scrutinizer Code Quality

执行速度

此组件提供计算执行速度的功能

安装

此包可以作为 Composer 依赖安装 bogkov/execution-speed

composer require bogkov/execution-speed

使用

<?php
$executionSpeed = new Bogkov\ExecutionSpeed\ExecutionSpeed($max = 50);
$executionSpeed->push($count = 100, $duration = 10);
$executionSpeed->push($count = 120, $duration = 11);
$executionSpeed->push($count = 90, $duration = 8);

echo 'Speed: ' . $executionSpeed->getSpeed($coefficient = 0.3, $precision = 2); // Speed: 10.85