summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2021-01-09 21:41:18 +0100
committerAnatol Belski <ab@php.net>2021-01-09 21:41:45 +0100
commit2cee1be6d14af1f088c253961e856d1b4af250d9 (patch)
treeecd604562623783ebd56161eb385796dabf82b34
parent23590f7c5348de4f8b69da81439b7c42c7ba084c (diff)
downloadphp-git-2cee1be6d14af1f088c253961e856d1b4af250d9.tar.gz
hash: Use hrtime() in the bench script [ci skip]
Signed-off-by: Anatol Belski <ab@php.net>
-rwxr-xr-xext/hash/bench.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/hash/bench.php b/ext/hash/bench.php
index 846163315b..9daafd5209 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);
}