30 |
$s = Encode::decode ('utf-8', $s); |
$s = Encode::decode ('utf-8', $s); |
31 |
my $time2 = time; |
my $time2 = time; |
32 |
my %time = (decode => $time2 - $time1); |
my %time = (decode => $time2 - $time1); |
33 |
|
my $char_length = length $s; |
34 |
|
|
35 |
print STDOUT "Content-Type: text/plain; charset=utf-8\n\n"; |
print STDOUT "Content-Type: text/plain; charset=utf-8\n\n"; |
36 |
|
|
78 |
print STDOUT "html5->dom5\t", $time{parse}, "s\n"; |
print STDOUT "html5->dom5\t", $time{parse}, "s\n"; |
79 |
print STDOUT "dom5->serialize\t", $time{serialize}, "s\n"; |
print STDOUT "dom5->serialize\t", $time{serialize}, "s\n"; |
80 |
print STDOUT "dom5 check\t", $time{check}, "s\n" if defined $time{check}; |
print STDOUT "dom5 check\t", $time{check}, "s\n" if defined $time{check}; |
81 |
|
for (qw/decode parse serialize check/) { |
82 |
|
next unless defined $time{$_}; |
83 |
|
open my $file, '>>', ".$_.txt" or die ".$_.txt: $!"; |
84 |
|
print $file $char_length, "\t", $time{$_}, "\n"; |
85 |
|
} |
86 |
} else { |
} else { |
87 |
print STDOUT "Status: 404 Not Found\nContent-Type: text/plain; charset=us-ascii\n\n404"; |
print STDOUT "Status: 404 Not Found\nContent-Type: text/plain; charset=us-ascii\n\n404"; |
88 |
} |
} |