2007年6月15日星期五

Speed up the programes

判断数组是否为空,几种方法的效率比较:

                          Total Elapsed Time   User+System Time
if($a[0])                           1                     1
if(exists($a[0]))                1.23                 1.22
if($#a)                             2.03                 2.02
if(@a)                              2.10                 2.09

没有评论: