2010-06-27 153 views
6

OS:WinXP的Eclipse来获取程序执行时间

在类UNIX环境下,我们可以通过$time ./my_program得到执行时间。我不知道我们可以在Eclipse中获得执行时间信息吗?没有探查器可以做到这一点吗?谢谢。

回答

0

您可以配置如何运行您的程序。转到菜单运行|运行...打开运行对话窗口。添加time命令以在控制台中显示运行时。

+11

你能更具体地在哪里添加时间命令吗? – Stan 2010-06-27 08:22:49

4

它看起来像TPTP Eclipse插件具有这样的特征:http://www.eclipse.org/tptp/

您可以通过时间戳的差异得到了它的近似:

public static void main(String[] args) throws IOException { 

    long start = System.currentTimeMillis();; 
    new MyApplication(); 
    long end = System.currentTimeMillis();; 

    System.out.println((end - start) + " ms"); 
    } 

这将打印在运行时毫秒。

+2

TPTP已停产。目前有什么? – 2013-11-27 20:33:21