X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=vendor%2Fmasterminds%2Fhtml5%2Ftest%2Fbenchmark%2Frun.php;fp=vendor%2Fmasterminds%2Fhtml5%2Ftest%2Fbenchmark%2Frun.php;h=bee7c2dd6f92cd507a7219c021706e494a90c0be;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hp=0000000000000000000000000000000000000000;hpb=aea91e65e895364e460983b890e295aa5d5540a5;p=yaffs-website diff --git a/vendor/masterminds/html5/test/benchmark/run.php b/vendor/masterminds/html5/test/benchmark/run.php new file mode 100644 index 000000000..bee7c2dd6 --- /dev/null +++ b/vendor/masterminds/html5/test/benchmark/run.php @@ -0,0 +1,29 @@ +loadHTML($content); + +$samples = array(); +for ($i = 0; $i < $iterations; $i++) { + $t = microtime(true); + $dom = $html5->loadHTML($content); + $samples[] = microtime(true) - $t; +} +$time = array_sum($samples) / count($samples); +echo "Loading: " . ($time * 1000) . "\n"; + +$samples = array(); +for ($i = 0; $i < $iterations; $i++) { + $t = microtime(true); + $html5->saveHTML($dom); + $samples[] = microtime(true) - $t; +} +$time = array_sum($samples) / count($samples); +echo "Writing: " . ($time * 1000) . "\n"; + +exit(0);