forked from veloper/Bench
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBenchmark.php
60 lines (51 loc) · 1.53 KB
/
Benchmark.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
/**
* Created by Perfect Web SRL
* User: Alin Jurj
* Date: 18.06.2014
* Time: 20:58
*/
class Benchmark extends Bench
{
function display()
{
$table = new Zend\Text\Table\Table(array(
'columnWidths' => array(
70,
25,
25
)
));
$table->appendRow(array(
'Section',
'Duration',
'Since start'
));
$longest = $this->getLongestMark();
$shortest = $this->getShortestMark();
foreach ($this->getMarks() as $mark) {
$table->appendRow(array(
$mark['id'],
$mark['since_last_mark'].'',
$mark['since_start'].''
));
}
$table->appendRow(array('', '', ''));
$table->appendRow(array(
'Longest: '.$longest['id'].'',
$longest['since_last_mark'].'',
$longest['since_start'].''
));
$table->appendRow(array(
'Shortest: '.$shortest['id'].'',
$shortest['since_last_mark'].'',
$shortest['since_start'].''
));
$table->appendRow(array(
'Average ',
$this->getMarkAverage().'',
''
));
echo $table;
}
}