Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Timing Database Performance

Posted on 2000-03-29
1
Medium Priority
?
154 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 200 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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

618 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