0

I want to know the elapsed time taken to run my C++ program. For example, when I compile and run a C++ program like this:

g++ -o myprogram myprogram.cpp

then:

myprogram

How can I do this from the Command Prompt (CMD) without including time.h in my C++ source file? (I am using Windows 10 64-bit)

Akhmad Zaki
  • 419
  • 7
  • 23
  • `#include` and use its tools. – user4581301 Jan 11 '18 at 06:50
  • 1
    Is this good enough? Powershell is the default shell in Windows 10 now. [How do I measure execution time of a command on the Windows command line?](https://stackoverflow.com/a/4801509/962089) There's always WSL, too, with familiar commands like `time`. – chris Jan 11 '18 at 06:52
  • @chris Just like `time` in Linux huh? I'm not the OP but you should write it as an answer. :) – Dean Seo Jan 11 '18 at 06:53
  • @DeanSeo, the link that chris provides looks like a duplicate. – R Sahu Jan 11 '18 at 07:01
  • The C++ tag is not necessary. The question can be asked for a Visual Basic program too. – R Sahu Jan 11 '18 at 07:03

0 Answers0