Solved

Timing Database Performance

Posted on 2000-03-29
1
136 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Pull multiple cvs files into one access table 28 68
VB6 - Convert HH:MM into Decimal 8 56
Spell Check in VB6 13 114
Added a column screws up code 5 57
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…

803 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