Solved

Timing Database Performance

Posted on 2000-03-29
1
144 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

688 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