1

I've been using VS and DevC++ to create C++ console programs, but I dislike that the output is in a console window. I'd like to be able to easily copy/paste text without needing to right click the window, go to properties, enable quickedit mode, and so forth.

Lastly, I'd like to be able to time how long my program takes to run (accurately). I am using Windows.

MyNameIsKhan
  • 2,496
  • 8
  • 29
  • 50

3 Answers3

0

You could use Eclipse. Eclipse for Java is a state of the art ide, and from what I have heard so far, so is Eclipse for C/C++. Netbeans for C++ is also a viable choice, along with Code::Blocks.

As for the console, I do not know if you can do it. You are running a console application and you don't want it to appear on a console? What kind of sorcery is that? Ok you could maybe just download an interactive shell for windows or something and manage to achieve what you want.

As for the timer, IDEs such as Visual Studio (the paid editions, can't talk about express edition) and Eclipse or Netbeans, feature a profiler, either by default, or by an add-on you must install, which can be used to evaluate your program and run several metrics on it.

NlightNFotis
  • 8,829
  • 5
  • 39
  • 62
0

As to the first part of your question, enabling QuickEdit is a once-only thing, so I really think it's far from onerous to select console text. You can always tee the output to a file when you invoke the application.

tee.exe

Depending on one's definition of "accurately", using clock() might suffice:

#include <time.h>
clock_t start, finish;
start = clock();
//  do stuff
finish = clock();
double duration = (finish-start) / (double)CLOCKS_PER_SEC;

This gives millisecond accuracy on Windows.

Josh Greifer
  • 2,805
  • 19
  • 23
  • 1
    I sometimes see people posting this sort of standardized output involving real/user/sys/etc, do you know where that comes from? – MyNameIsKhan Jun 08 '12 at 13:16
  • It comes from the unix "time" command - http://superuser.com/questions/88387/windows-analog-to-unix-time-command – Josh Greifer Jun 08 '12 at 13:24
  • @JoshGriefer Is there a way to increase precision in the output duration? When I try it, my quicker programs just display 0. – MyNameIsKhan Jun 08 '12 at 13:35
  • The simplest solution is to repeat the run and take the average. Or else use `QueryPerformanceCounter()` in Windows, which gives higher accuracy. – Josh Greifer Jun 08 '12 at 13:38
0

Try Console - http://sourceforge.net/projects/console/

kjp
  • 2,961
  • 17
  • 29