From 2cee1be6d14af1f088c253961e856d1b4af250d9 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Sat, 9 Jan 2021 21:41:18 +0100 Subject: [PATCH] hash: Use hrtime() in the bench script [ci skip] Signed-off-by: Anatol Belski --- ext/hash/bench.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/hash/bench.php b/ext/hash/bench.php index 846163315b8..9daafd5209e 100755 --- a/ext/hash/bench.php +++ b/ext/hash/bench.php @@ -11,15 +11,15 @@ foreach (hash_algos() as $algo) { for ($j = 0; $j < 10; $j++) { foreach (hash_algos() as $algo) { - $start = microtime(true); + $start = hrtime(true); for ($i = 0; $i < 1000; $i++) { hash($algo, $data); } - $time[$algo] += microtime(true)-$start; + $time[$algo] += hrtime(true)-$start; } } asort($time, SORT_NUMERIC); foreach ($time as $a => $t) { - printf("%-12s %02.6f\n", $a, $t); + printf("%-12s %02.6f\n", $a, $t/1000000000); }