変換にかかる時間

                             <p>ソースコード</p>
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/perl

# 初期設定
use Jcode;
$JcodeVer = "Jcode $Jcode::VERSION";
*Jgetcode = &amp;Jcode::getcode;
*Jconvert = &amp;Jcode::convert;

$G_myCode = &amp;Jgetcode("漢字");
$G_code = "jis";
$G_charset = "iso-2022-jp";

{
    $icode = 'sjis';
#    $icode = 'euc';
#    $icode = 'jis';
#    $icode = 'utf8';
    $ocode = 'sjis';
#    $ocode = 'euc';
#    $ocode = 'jis';
#    $ocode = 'utf8';

    print("Content-type: text/htmlnn");
    $japanese = 'あいうえお阿衣兎得緒';
    $japanese = &amp;Jconvert($japanese, $icode);
    print(&amp;getTime);
    print(' : BeginTime ');
    print("<br>");
    for(1 .. 50000){
        &amp;Jconvert($japanese, $ocode, $icode);
    }
    print(&amp;getTime);
    print(' : EndTime');
    exit(0);
}

sub getTime{
    my ($sec,$min,$hour,$day,$mon,$year) = localtime(time);
    return sprintf("%4d/%02d/%02d %02d:%02d:%02d",
                $year+1900,$mon+1,$day,$hour,$min,$sec);
}
                          </div>

Comments

comments powered by Disqus