|< 1 2 >| | 12 Einträge, 2 Seiten |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/perl -w
use Digest::MD5 qw(md5_hex);
use Time::HiRes qw(gettimeofday tv_interval);
my $howmany = shift || 100;
my $t0;
$t0 = [ gettimeofday ];
for (1..$howmany) { system("md5sum", $0) }
print STDERR tv_interval($t0), "\n";
$t0 = [ gettimeofday ];
for (1..$howmany) {
open(my $SELF, $0) or die $!;
local $/ = undef;
my $buf = <$SELF>;
close $SELF;
print md5_hex($buf), "\n";
}
print STDERR tv_interval($t0), "\n";
skript.pl 1000 > /dev/null
$ time perl -MDigest::MD5 -e 'while($f=shift){open F,$f or do {warn $!; next}; binmode F; print Digest::MD5->new->addfile(*F)->hexdigest, " $f\n"; close F; }' * > /dev/null
$ time md5sum * > /dev/null
|< 1 2 >| | 12 Einträge, 2 Seiten |