Skip to content

Commit

Permalink
added documentation to benchmark result
Browse files Browse the repository at this point in the history
added getter for memory
added difference for benchmarking block of code
  • Loading branch information
Alexander Gaal committed May 4, 2017
1 parent a4226b4 commit edb13e9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 8 deletions.
10 changes: 10 additions & 0 deletions Benchmark.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ class Benchmark
*/
protected $startTime = 0;

/**
* @var float
*/
protected $difference = 0;

/**
* @var array
*/
Expand Down Expand Up @@ -229,6 +234,11 @@ public function getMinutes()
return $this->getDifference() / 60;
}

public function getMemory()
{
return $this->memory;
}

/**
* Compares this benchmark with another given benchmark.
*
Expand Down
25 changes: 17 additions & 8 deletions BenchmarkResult.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
<?php
/**
* Created by PhpStorm.
* User: Alexander Gaal
* Date: 04.05.2017
* Time: 15:32
*/

namespace Alexgaal\Benchmark;


/**
* Class BenchmarkResult
* @package Alexgaal\Benchmark
*/
class BenchmarkResult
{
/**
* @var array
*/
protected $memory = [];

/**
* @var float
*/
protected $time = 0;

/**
* BenchmarkResult constructor.
*
* @param array $memory
* @param float $time
*/
function __construct($memory = null, $time = null)
{
if (null !== $memory)
Expand Down

0 comments on commit edb13e9

Please sign in to comment.