定时程序执行
我有一个用 C 编写的项目,我想知道是否有一种简单的方法可以在 Windows 下分析其执行时间和内存使用情况。
提前致谢。
I have a project written 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
计时信息很简单:创建一个调用程序的.bat文件,在程序启动之前和结束之后输出当前系统时间...伪代码如下:
至于内存消耗,我想说它有点复杂,尽管绝对可行。您可以尝试这些行。 。
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:
As for memory consumption, I would say it's a bit more involved, although definitely doable. You might try something along these lines...
您可以启动进程监视器,运行您的程序,然后返回到 procmon 并使用工具/进程活动摘要来概述程序使用的时间和内存。
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.