makeMaskNo($maskNo, $width, $frame, $bitMask, true); } } QRtools::markTime('after_build_cache'); } static public function log($outfile, $err) { if (QR_LOG_DIR !== false) { if ($err != '') { if ($outfile !== false) { file_put_contents(QR_LOG_DIR . basename($outfile) . '-errors.txt', date('Y-m-d H:i:s') . ': ' . $err, FILE_APPEND); } else { file_put_contents(QR_LOG_DIR . 'errors.txt', date('Y-m-d H:i:s') . ': ' . $err, FILE_APPEND); } } } } static public function dumpMask($frame) { $width = count($frame); for ($y = 0; $y < $width; $y++) { for ($x = 0; $x < $width; $x++) { echo ord($frame[$y][$x]) . ','; } } } static public function markTime($markerId) { list($usec, $sec) = explode(' ', microtime()); $time = (double) $usec + (double) $sec; if (!isset($GLOBALS['qr_time_bench'])) { $GLOBALS['qr_time_bench'] = array(); } $GLOBALS['qr_time_bench'][$markerId] = $time; } static public function timeBenchmark() { self::markTime('finish'); $lastTime = 0; $startTime = 0; $p = 0; echo '
| BENCHMARK | |
| till ' . $markerId . ': | ' . number_format($thisTime - $lastTime, 6) . 's |
|---|---|
| TOTAL: | ' . number_format($lastTime - $startTime, 6) . 's |