【问题标题】:How to run shell "time" command every time eclipse runs executable?每次eclipse运行可执行文件时如何运行shell“时间”命令?
【发布时间】:2013-05-17 23:23:07
【问题描述】:

我希望 eclipse 打印出程序在运行时执行的时间。 我正在使用 Linux Mint,并且 shell 有一个我一直使用的“时间”命令。

 time ./myPgrogram.out

我搜索了这是否可能,我发现了一个帖子: Is there an Eclipse plugin to run system shell in the Console?

这允许我在 Eclipse 中使用控制台,但这很糟糕,首先因为如果我想使用控制台,我不会在第一次调整 Eclipse,其次,因为 Mint 的控制台要好得多比日食提供的还要多。

所以,我想知道,每次单击顶部的绿色三角形并运行可执行文件时,是否可以让 eclipse 打印出程序运行所需的“时间”?如果有,怎么做?

我也找到了这个帖子,但我不确定它是否有帮助: Compiling in Eclipse with gcc's -lpthread and -lrt set 他们用它来链接某些命令到像“-lpthread”这样的eclipse,我不知道我是否可以链接“时间”并最终打印出来。

【问题讨论】:

    标签: eclipse shell time


    【解决方案1】:

    我不使用 Eclipse,但我认为您应该对 "profiler/profiling" 感兴趣。
    它是测量程序使用的时间和内存的工具,大多数 IDE 都有这样的东西,或者可以使用外部的。

    例如我找到了this (回答问题Linux Eclipse CDT profiler)。

    我不会为您提供更多帮助,因为我仍然在控制台中使用“时间”来测试在 Geany(Linux Mint 上)中创建的 C/C++ 程序;)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-06-12
      • 2012-01-18
      • 1970-01-01
      • 2017-08-30
      • 2015-06-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多