From 0226e0ca0dc70f9a0310b3eef045ee1c1e0ca3ac Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 13 Dec 2022 20:00:46 +0300 Subject: split into a separate repo --- vendor/masterminds/html5/test/benchmark/run.php | 29 +++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 vendor/masterminds/html5/test/benchmark/run.php (limited to 'vendor/masterminds/html5/test/benchmark/run.php') diff --git a/vendor/masterminds/html5/test/benchmark/run.php b/vendor/masterminds/html5/test/benchmark/run.php new file mode 100644 index 0000000..2ca1907 --- /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); -- cgit v1.2.3