Solved

Timing Database Performance

Posted on 2000-03-29
1
132 Views
Last Modified: 2010-05-02
Hi,

    I'm doing a bit of performance testing to compare inline SQL with stored procs. I need a way to time the execution of the stored proc from VB. The timer control is a pain in the ass - what's the easiest way to do this (down to the millisecond if poss, thousandths will probably do).

All I want to do is call a sub to start and stop the timer, e.g.

StartTimer
set rsResults = BusinessObject.getResults
lngTime = StopTimer

Something like that would be cool.

Cheers, Nik.

0
Comment
Question by:NikWhitfield
1 Comment
 
LVL 3

Accepted Solution

by:
wpsjr1 earned 50 total points
ID: 2666524
Option Explicit

Declare Function timeGetTime Lib "winmm.dll" () As Long

Dim lStartTime&

Sub StartTimer()
  lStartTime = timeGetTime
End Sub

Function StopTimer() As Long
  StopTimer = timeGetTime - lStartTime
End Function

That should do it.

0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now