473,732 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Timing a proecess in Access2000

Is there as simple way to time a process (down to the ms) while
running Access2000 VBA code? I want to test the time taken to run
various functions.
Nov 12 '05 #1
4 2424
Save the time at the start and end of the function then output end - start
time.

"Lauren Quantrell" <la************ *@hotmail.com> wrote in message
news:47******** *************** ***@posting.goo gle.com...
Is there as simple way to time a process (down to the ms) while
running Access2000 VBA code? I want to test the time taken to run
various functions.

Nov 12 '05 #2
la************* @hotmail.com (Lauren Quantrell) wrote in message news:<47******* *************** ****@posting.go ogle.com>...
Is there as simple way to time a process (down to the ms) while
running Access2000 VBA code? I want to test the time taken to run
various functions.


use GetTickCount... from www.mvps.org/vbnet

''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''
' Copyright ©1996-2003 VBnet, Randy Birch, All Rights Reserved.
' Some pages may also contain other copyrights by the author.
''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''
' Distribution: You can freely use this code in your own
' applications, but you may not reproduce
' or publish this code on any web site,
' online service, or distribute as source
' on any media without express permission.
''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''
Private Declare Function GetTickCount Lib "kernel32" () As Long
Private tstart As Single

Private Enum ElapsedTimeType
ttMilliseconds = 1
ttSeconds = 2
ttMinutes = 3
End Enum
Private Function GetElapsedTime( dwTimeType As ElapsedTimeType ) As Single

Dim divisor As Long

Select Case dwTimeType
Case ttMilliseconds: divisor = 1
Case ttSeconds: divisor = 1000
Case ttMinutes: divisor = 60000
End Select

GetElapsedTime = (GetTickCount() - tstart) / divisor

End Function
Private Sub Form_Load()

'Assign the current tick count
'as the tick start point. Failure
'to do this will return the number
'of ticks since Windows was last
'rebooted. (Note: elapsed time is
'stored as a DWORD value in Windows.
'Therefore, the time will wrap around
'to zero if the system is run continuously
'for 49.7 days. If a higher resolution
'timer is required, use a multimedia
'or high-resolution timer.
tstart = GetTickCount()

End Sub
Nov 12 '05 #3
On 3 Nov 2003 11:30:47 -0800, pi********@hotm ail.com (Pieter Linden)
wrote:

Using GetTickCount, you could write your own class. I called mine
clsStopwatch, and it has methods like Start, Stop, and Peek.

Also please note that "down to the ms" may be somewhat difficult.
Simple timers like GetTickCount don't necessarily have that
resolution. If your function is fast, you may want to run it a
thousand or a million times, rather than once.

-Tom.

la************ *@hotmail.com (Lauren Quantrell) wrote in message news:<47******* *************** ****@posting.go ogle.com>...
Is there as simple way to time a process (down to the ms) while
running Access2000 VBA code? I want to test the time taken to run
various functions.


use GetTickCount... from www.mvps.org/vbnet

<clip>

Nov 12 '05 #4

"Lauren Quantrell" <la************ *@hotmail.com> wrote in message
news:47******** *************** ***@posting.goo gle.com...
Is there as simple way to time a process (down to the ms) while
running Access2000 VBA code? I want to test the time taken to run
various functions.


dblTStart = Timer()
....Do something
dblTStop = Timer()
Debug.Print Int((dblTStop - dblTStart) * 1000) & " ms"

Erik Rudbeck
Nov 12 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
2164
by: Greg Stark | last post by:
This query is odd, it seems to be taking over a second according to my log_duration logs and according to psql's \timing numbers. However explain analyze says it's running in about a third of a second. What would cause this? Is it some kind of postgresql.conf configuration failure? I have the same query running fine on a different machine. QUERY PLAN...
2
10549
by: Mike Metzger | last post by:
I've been running an Access2000 database for a couple years on a Win2k machine fine. We tried to copy the database over to another machine that already had Access2000 installed. When we tried to run it, we got an error on the following piece of VBA code embedded in a form: ------------------------ With Me .AgeMax = DateDiff("yyyy", Me.dteDateOfBirthMin, Date) .AgeMin = DateDiff("yyyy", Me.dteDateOfBirthMax, Date) End With...
1
2648
by: Mario Crevits | last post by:
My name is Mario Crevits, I'm from Belgium (Roeselare) and I'm working with Access97 for several years now. We are in an Access97-2000 migration project. I'm writing a wizard for the end-users to automatically find and convert their Access97 databases on a specific drive. I want to convert the databases through VBA : 1. create an empty Access2000 2. set the right properties and references 3. import the objects (tables, queries,...
7
3768
by: jamie | last post by:
hey all, I am attempting to do motion control for a final project, but I have a concern.... For motion control, timing is everyting, the better it is, the better it works. Currently I am trying to use the timer function block to do a 10ms loop, but if I remember correctly.... that timing
1
1419
by: Novice | last post by:
Hi all, I'm at my wit's end on trying to insert some timing code into the server side code that parses the hashed data contained in the hidden field being submitted to the server I've tried placing timing code in all of the following: Page_Load OnInit LoadViewState(object savedState) object SaveViewState()
3
1695
by: gregory_may | last post by:
I have an application where I am using a System Thread to capture the screen & Broadcast it to clients. Its "working", but the timing on the background thread gets wildly erratic at times. Some times, its right away, some times after 10 seconds. I have included the setup of the process and the outline of the Call Back Method. As posted, the callback method can be mildly erratic (only doing a debug.writeline) I am guessing up to an 80%...
2
3305
by: Steven D'Aprano | last post by:
The timeit module is ideal for measuring small code snippets; I want to measure large function objects. Because the timeit module takes the code snippet argument as a string, it is quite handy to use from the command line, but it is less convenient for timing large pieces of code or when working in the interactive interpreter. E.g. variations on this *don't* work: $ python Python 2.4.3 (#1, Jun 13 2006, 11:46:08)
6
1818
by: alanpike | last post by:
Using SendObject in an Access2000 macro, I can send a report as an email attachment to MS Outlook. I would like the capability to have the person reading the attached email report to somehow communicate (from the open outlook message...a button or something) their approval or rejection of the email which initiates another macro in Access2000. Is this possible and if so, where can I find some info concerning this type of automation?
3
1787
by: olle | last post by:
How to deal with a VBA-project that is damaged? Hi everyone. I am BigOlle from sweden and I have been working with Accees for ten years I am now working on a project that started in Access97 and since a few months it continues in Access2000. My plan is to use Access2000 as it is supposed that mdb-files in Access 2000-format can be opened from all Access versions after that
0
9307
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9235
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9181
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8186
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6735
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3261
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.