VB6 应用时序 [英] VB6 Application timing

查看:14
本文介绍了VB6 应用时序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试分析 VB6 应用程序.

I am attempting to profile a VB6 application.

基本上,我想逐个计算方法级别的执行时间.

Basically I wanted to work out at a method by method level how much time execution is taking.

然而,VB6 只支持时间到 1 秒.有什么好的方法可以计算毫秒等吗?

However VB6 only supports times to 1 sec. Is there any good way of working out millisecs etc ?

推荐答案

虽然 MSDN 定时器 只精确到 1 秒,我发现它比实践中的要好.

Although MSDN says Timer is only accurate to 1 second, I've found it's better than that in practise.

GetTickCount 通常准确到 大约 10 到 16 毫秒.这是一个 VB6 声明.

GetTickCount is typically accurate to about 10 to 16 milliseconds. Here's a VB6 declaration.

 Declare Function GetTickCount Lib "Kernel32" () As Long

相同的 Microsoft 文章 展示了如何使用 QueryPerformanceCounter获得更高的准确度,前提是您的 PC 支持它,并且如果您需要它.

The same Microsoft article shows how to use QueryPerformanceCounter to get much higher accuracy, if your PC supports it, and if you need it.

这篇关于VB6 应用时序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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