I have created a benchmark class that allows the user to insert for example
$timer->checkpoint('2');
to check out some code for time,memory consumption and such….
at the end of the code she/he wants to test she/he has to insert
$result=$timer->result();
this gives out some data to public function result()
when I rdie $resultmem it gives out
( [1] => 0.038664817810059 [2] => 0.038440942764282 [3] => 0.0019619464874268 )
(the code is below)
I would like to beautify it so I gives out for e.g.
Checkpoint 1 = 0.038664817810059
Checkpoint 2 = 0.038440942764282
…
…
depending on the number of checkpoints
How to do this? I have never done this before. Could you please help me out?
I apologize for my ignorance, but I’m a bit of a n00b
public function result(){
$resultmem=$this->getAllMemoryTrackers();
$resulttime=$this->getAllTimes();
foreach($resultmem as $mem){
rdie ($resultmem);
}
foreach($resulttime as $time){
rdie ($resulttime);
}
}
Just simply loop thorough and print out the key and the value of each element.