Benchmark class is a lite cli tool for benchmarking codes. It uses a static method fn
to run series of code lines and then it tries to generate benchmark table for each code group it executes.
An example of this is shown below:
\spoova\mi\core\classes\Benchmark::fn([
'querie' => function(){
$Hasher = new \spoova\mi\core\classes\Hasher;
$Hasher->setHash(['loomars'], '1234');
$hash = $Hasher->hashify();
},
'querier' => function(){
for($i = 0; $i <= 99999; $i++){
$Hasher = new \spoova\mi\core\classes\Hasher;
$Hasher->setHash(['loomars'], '1234');
$hash = $Hasher->hashify();
}
}
])
php mi :wiz