forked from glympero/php-execution-time-recorder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
41 lines (27 loc) · 756 Bytes
/
index.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
<?php
include "ExecutionTimeRecorder.php";
//First Timer
$timer_1 = new ExecutionTimeRecorder();
//Start Timer
$timer_1->startTimer("First Timer");
//Block of code to test. In this case just a delay of the execution
echo "Sleeping for 2 seconds<br/>";
sleep(2);
//Stop Timer
$timer_1->endTimer();
//Show total time
echo $timer_1->totalTimer();
//Second Timer
$timer_2 = new ExecutionTimeRecorder();
//Start Timer
$timer_2->startTimer("Second Timer");
//Block of code to test. In this case just a delay of the execution
echo "Counting to 15000000...<br/>";
for ($x = 0; $x <= 15000000; $x++) {
}
//Stop Timer
$timer_2->endTimer();
//Show total time
echo $timer_2->totalTimer();
//Time to run page
echo ExecutionTimeRecorder::totalExecution();