use Time::HiRes 'time'; use Crypt::Eksblowfish::Bcrypt qw(bcrypt en_base64); sub _salt() { return en_base64('abcdefghijklmnop'); } my $cost = sprintf("%02d", $ARGV[0]); my $settings = join( '$', '$2a', $cost, _salt() ); my $st = time(); print bcrypt("password", $settings), "\n"; printf "took %i milliseconds\n", (time() - $st) * 1000;