0

I want eclipse to print out the time a program takes to execute when it runs. I am using Linux Mint, and the shell has a "time" command that I use all the time.

 time ./myPgrogram.out

I searched if this was possible and I found a post: Is there an Eclipse plugin to run system shell in the Console?

That allows me to use a console in eclipse, but that sucks, first because if I wanted to use the console, I wouldn't be tunning up eclipse in the first time, and second, because Mint's console is a lot better than the one eclipse provides.

So, I wonder, is it possible to make eclipse print out the "time" a program takes to run every time i click the green triangle on the top and run an executable? If so, how?

I also found this thread, but I am not sure if it can help: Compiling in Eclipse with gcc's -lpthread and -lrt set They use it to link certain commands to eclipse like "-lpthread", I don't know if I can link "time" and print it in the end.

Community
  • 1
  • 1
Flame_Phoenix
  • 16,489
  • 37
  • 131
  • 266

1 Answers1

0

I don't use Eclipse but I think you should interested in "profiler/profiling".
It's tool to measuring time and memory used by program and most IDEs have something like this or can use external one.

For example I found this (in answer to question Linux Eclipse CDT profiler).

I don't help you more because I still use "time" in console to test C/C++ programs created in Geany (on Linux Mint) ;).

Community
  • 1
  • 1
furas
  • 134,197
  • 12
  • 106
  • 148