I need to measure memory usage and execution time of any Windows executable file by creating some batch file or code snippet. And just like the online judges, I want the process to be fully automated, so I don't have to open Task Manager every time I need to measure, or inserting additional lines into the original source files.
For example, if I compile this particular C++ source to an executable a.exe
:
#include <cstdio>
int main()
{
printf("%d", 1 + 2);
}
And measure the execution time and memory usage of this particular a.exe
, the batch should produce something like:
Used: 0.015s, 3092K
I have researched for hours on StackOverflow, but the result is either for UNIX binaries, or code lines for embedding into the source.
Many thanks in advance.