set-cost.php

File Type: php File Location: monofiles/ File name: set-cost.php
<?php

include_once 'data_connect.php';
    
    
$phtime 0.2// 200 ms
     
    
for ($cost 4; ; $cost++){
        
    
$start microtime(true);
    
password_hash("test"PASSWORD_DEFAULT, ["cost" => $cost]);
    
$finish microtime(true);
        
        if ((
$finish-$start) > 1) {
    
            
$pass_info password_get_info($password);
            
$cost $pass_info[options][cost];
            break;
        }
        
        if ((
$finish-$start) > $phtime)
            break;

        }
?>