perl の処理時間を関数事に表示するモジュール
>perl -MCPAN -e 'CPAN::Shell->install("Devel::Profile ")'
>perl -d:Profile subtst.pl
■テストファイル
C:\cygwin\home\yumino\work
subtst.pl
#!/usr/bin/perl sub aaa{ print "hello world\n"; } sub bbb{ print "hello world\n"; } sub ccc{ print "hello world\n"; } sub ddd{ print "hello world\n"; } aaa; for(1 .. 100){ bbb; } ccc; ddd;
■テスト結果
time elapsed (wall): 0.0392 time running program: 0.0272 (69.52%) time profiling (est.): 0.0120 (30.70%) number of calls: 104 %Time Sec. #calls sec/call F name 66.82 0.0182 0 0.018193 * <other> 29.18 0.0079 100 0.000079 main::bbb 2.07 0.0006 1 0.000563 main::aaa 1.13 0.0003 1 0.000307 <anon>:./subtst.pl:0 0.27 0.0001 1 0.000073 <anon>:...erl/5.8/Devel/Profile.pm:321 0.26 0.0001 1 0.000072 main::ddd 0.23 0.0001 1 0.000064 main::ccc 0.05 0.0000 1 0.000014 strict::import
出展:http://perldoc.jp/docs/modules/Devel-Profile-1.04/Profile.pod