VB6中计时功能/测量性能的最佳方法是什么? [英] What's the best way of timing functions / measuring performance in VB6?

查看:67
本文介绍了VB6中计时功能/测量性能的最佳方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我只是想快速测量某个特定功能需要花费多长时间,该如何打电话才能获得准确的时间安排?鉴于VB6计时功能的精度不高,您是否可以调用Windows API功能?

If I just want to do a quick measurement of how long a particular function is taking, what can I call to get an accurate timing? Given that the VB6 timing functions aren't high precision, are there Windows API functions you call instead?

您还可以通过哪些其他方式来评估应用程序性能?您是否推荐任何第三方工具?

In what other ways do you measure application performance? Are there any third-party tools that you recommend?

推荐答案

我通常使用Windows hihg分辨率性能计数器.查看 QueryPerformanceCounter

I typically use the Windows hihg resolution performance counters. Check out QueryPerformanceCounter and QueryPerfomanceFrequency

通常我有一个简单的类,该类的构造函数和析构函数调用QueryPerformanceCounter,然后将差值添加到正在运行的总计中.

Typically I have a simple class whose constructor and destructor place a call to QueryPerformanceCounter and then add the difference to a running total.

有关工具,请查看 devpartner .尽管运行良好,但对大部分代码进行检测会使我的应用程序运行异常缓慢.通常,我通常希望仅对一个或两个函数获得准确的时间安排,因此我经常使用性能计数器函数而不是使用devpartner.

For tools check out devpartner. While it works well, instrumenting significant portions of code makes my application run unbearably slow. I typically find I wish to get precise timing on just one or two functions so I frequently end up using the performance counter functions and not using devpartner.

这篇关于VB6中计时功能/测量性能的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆