- password_hash: documentation ( source)
- microtime: documentation ( source)
<?php
$time_start = microtime(true);
echo password_hash('password', PASSWORD_ARGON2I, ['memory_cost' => 1<<14, 'time_cost' => 20, 'threads' => 5]).PHP_EOL;
$time_end = microtime(true);
//dividing with 60 will give the execution time in minutes other wise seconds
$execution_time = ($time_end - $time_start);
//execution time of the script
echo 'Total Execution Time: '.$execution_time.' Secs'.PHP_EOL;