开发者

Timing program execution

开发者 https://www.devze.com 2022-12-24 05:21 出处:网络
I have a project writ开发者_高级运维ten in C and I would like to know if there is a simple way to profile its execution time and memory usage under Windows.

I have a project writ开发者_高级运维ten in C and I would like to know if there is a simple way to profile its execution time and memory usage under Windows.

Thanks in advance.


You can launch process monitor, run your program, and then go back to procmon and use Tools/Process Activity Summary to have an overview of the time and memory used by your program.


Timing information is easy enough: create a .bat file invoking the program, output the current system time before the program starts and after it ends...something like this in pseudocode:

print system time
execute program
print system time

As for memory consumption, I would say it's a bit more involved, although definitely doable. You might try something along these lines...

0

精彩评论

暂无评论...
验证码 换一张
取 消