今天看啥
热点:

java写的 echo 和 linux系统自带的 echo 效率差别很大!


[[email protected] 0]$ uname -o
GNU/Linux
[[email protected] 0]$ which echo
/bin/echo
[[email protected] 0]$ time /bin/echo 1234
1234

real	0m0.011s
user	0m0.001s
sys	0m0.009s
[[email protected] 0]$ ls
echo.java
[[email protected] 0]$ cat echo.java 
public class echo {
  public static void main(String []args) {
    if (args != null) {
      System.out.printf("%s\n", args[0]);
    }
  }
}
[[email protected] 0]$ javac echo.java 
[[email protected] 0]$ which java
/usr/bin/java
[[email protected] 0]$ time /usr/bin/java echo 1234
1234

real	0m0.208s
user	0m0.026s
sys	0m0.181s
[[email protected] 0]$ 

\

						

www.bkjia.comtruehttp://www.bkjia.com/Javabc/1005557.htmlTechArticlejava写的 echo 和 linux系统自带的 echo 效率差别很大! [[email protected] 0]$ uname -oGNU/Linux[[email protected] 0]$ which echo/bin/echo[[email protected] 0]$ time /bin/echo 1234...

相关文章

相关搜索: 差别 效率 系统

帮客评论

视觉看点