diff options
| author | fukachan <fukachan> | 2001-06-01 14:27:20 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2001-06-01 14:27:20 +0000 |
| commit | b9f628acbd9ade8eac8cb0b77d9c28611120f33e (patch) | |
| tree | da2b07299f4a0396062241a2a3d3fcffa6be7d32 /cpan/dist/Jcode/t/unibench.pl | |
| parent | 741843f930a4aa542ca51e7e27b9b2871f36a66b (diff) | |
| download | fml8-Jcode-0-71.tar.gz fml8-Jcode-0-71.tar.bz2 fml8-Jcode-0-71.zip | |
Jcode-0.71Jcode-0-71
Diffstat (limited to 'cpan/dist/Jcode/t/unibench.pl')
| -rw-r--r-- | cpan/dist/Jcode/t/unibench.pl | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/cpan/dist/Jcode/t/unibench.pl b/cpan/dist/Jcode/t/unibench.pl index 6a7e084c..d9ac7a42 100644 --- a/cpan/dist/Jcode/t/unibench.pl +++ b/cpan/dist/Jcode/t/unibench.pl @@ -2,16 +2,16 @@ use ExtUtils::testlib; use Benchmark; +use strict; +use lib qw(.); $| = 1; - -print "Jcode Loading...\n"; require Jcode; $Jcode::DEBUG = 1; +$Jcode::NOXS = $ARGV[0]; print "done.\n"; - -$file = "t/table.euc"; +my $file = "t/table.euc"; open F, $file or die "$file:$!"; my $euc; read F, $euc, -s $file; @@ -19,16 +19,14 @@ read F, $euc, -s $file; my $ucs2 = Jcode->new($euc)->ucs2; my $utf8 = Jcode->new($euc)->utf8; -my $count = $ARGV[0] || 16; +my $count = $ARGV[1] || 16; timethese($count, { "utf8->ucs2" => \&utf8_ucs2, "ucs2->utf8" => \&ucs2_utf8, - "euc->ucs2" => \&euc_ucs2, - "ucs2->euc" => \&ucs2_euc, - } - ); - + "ucs2->euc" => \&ucs2_euc, + "ucs2->utf8" => \&ucs2_utf8, +}); sub utf8_ucs2{ &Jcode::utf8_ucs2($utf8); @@ -45,3 +43,4 @@ sub euc_ucs2{ sub ucs2_euc{ &Jcode::ucs2_euc($ucs2); } + |
