MCPcopy Create free account
hub / github.com/codemistic/Web-Development / timeBenchmark

Method timeBenchmark

text-to-qr/lib/phpqrcode/qrtools.php:138–165  ·  view source on GitHub ↗

----------------------------------------------------------------------

()

Source from the content-addressed store, hash-verified

136
137 //----------------------------------------------------------------------
138 public static function timeBenchmark()
139 {
140 self::markTime('finish');
141
142 $lastTime = 0;
143 $startTime = 0;
144 $p = 0;
145
146 echo '<table cellpadding="3" cellspacing="1">
147 <thead><tr style="border-bottom:1px solid silver"><td colspan="2" style="text-align:center">BENCHMARK</td></tr></thead>
148 <tbody>';
149
150 foreach($GLOBALS['qr_time_bench'] as $markerId=>$thisTime) {
151 if ($p > 0) {
152 echo '<tr><th style="text-align:right">till '.$markerId.': </th><td>'.number_format($thisTime-$lastTime, 6).'s</td></tr>';
153 } else {
154 $startTime = $thisTime;
155 }
156
157 $p++;
158 $lastTime = $thisTime;
159 }
160
161 echo '</tbody><tfoot>
162 <tr style="border-top:2px solid black"><th style="text-align:right">TOTAL: </th><td>'.number_format($lastTime-$startTime, 6).'s</td></tr>
163 </tfoot>
164 </table>';
165 }
166
167 }
168

Callers 1

index.phpFile · 0.45

Calls 1

markTimeMethod · 0.95

Tested by

no test coverage detected