]> git.immae.eu Git - github/fretlink/blazeT.git/blob - src/Benchmarks/bigtable/php.php
Initial
[github/fretlink/blazeT.git] / src / Benchmarks / bigtable / php.php
1 <?php
2 $table = array_fill(0, 1000, array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
3
4 function test_bigtable($table) {
5 ob_start();
6 ?>
7 <table>
8 <?php foreach($table as $row) { ?>
9 <tr>
10 <?php foreach($row as $value) { ?>
11 <td><?php echo $value; ?></td>
12 <?php } ?>
13 </tr>
14 <?php } ?>
15 </table>
16 <?php
17 return ob_get_clean();
18 }
19
20 $request_count = 1000;
21
22 $start = microtime(true);
23 for ($i = 0; $i < $request_count; $i++)
24 {
25 test_bigtable($table);
26 }
27 $elapsed = microtime(true) - $start;
28 $time_per_request = ($elapsed / $request_count) * 1000;
29 echo "\"PHP\", $time_per_request\n";
30 ?>