<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1170" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><SPAN class=240483413-25062003><FONT face=Arial color=#0000ff
size=2>Rocky,</FONT></SPAN></DIV>
<DIV><SPAN class=240483413-25062003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=240483413-25062003><FONT face=Arial color=#0000ff size=2>Here
is the class I use for timing things such as the opening of forms and such, with
a timer test function you can place in a module to play around with the
class. Dead simple to use.</FONT></SPAN></DIV>
<DIV><SPAN class=240483413-25062003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=240483413-25062003><FONT face=Arial color=#0000ff size=2>The
nice thing about using a class is that you can have as many instances as you
need timing various stuff since the variable tracking elapsed time is private to
the class instance.</FONT></SPAN></DIV>
<DIV><SPAN class=240483413-25062003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=240483413-25062003><FONT face=Arial color=#0000ff size=2>
<DIV><SPAN class=240483413-25062003><FONT face=Arial color=#0000ff size=2>Option
Compare Database<BR>Option Explicit<BR>Dim mclsTimer As
clsTimer</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=240483413-25062003><FONT face=Arial color=#0000ff
size=2>Function TestTimer()<BR>Set mclsTimer = New
clsTimer<BR> MsgBox "Hit any key to continue", , "TIMER TEST
1"<BR> MsgBox mclsTimer.EndTimer & " ms elapsed time - Hit
any key to continue", , "TIMER TEST 1"<BR> MsgBox
mclsTimer.EndTimer & " ms total elapsed time - Hit any key to continue", ,
"TIMER TEST 2"<BR> mclsTimer.StartTimer<BR>
MsgBox "Hit any key to continue", , "TIMER TEST 3"<BR> MsgBox
mclsTimer.EndTimer() & " ms elapsed time", , "TIMER
TEST3"<BR> Set mclsTimer = Nothing<BR>End
Function<BR></DIV></FONT></SPAN></FONT></SPAN></DIV>
<DIV><SPAN class=240483413-25062003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=240483413-25062003><FONT face=Arial color=#0000ff size=2>Option
Compare Database<BR>Option
Explicit<BR>'.===============================================================<BR>'.Copyright
2001 Colby Consulting. All rights
reserved.<BR>'.E-mail : <A
href="mailto:jcolby@colbyconsulting.com">jcolby@colbyconsulting.com</A><BR>'.===============================================================<BR>'
DO NOT DELETE THE COMMENTS ABOVE. All other comments in this module<BR>'
may be deleted from production code, but lines above must
remain.<BR>'---------------------------------------------------------------------<BR>'.Description
: Implements the instantiated class for: clsTimer<BR>'.<BR>'.Written
By : John W. Colby<BR>'.Date Created : 05/28/2001<BR>' Rev. History
:<BR>'<BR>' Comments
:<BR>'---------------------------------------------------------------------<BR>'.<BR>'
ADDITIONAL
NOTES:<BR>'<BR>'---------------------------------------------------------------------<BR>'<BR>'
INSTRUCTIONS:<BR>'---------------------------------------------------------------------<BR>'.<BR>'THESE
CONSTANTS AND VARIABLES ARE USED INTERNALLY TO THE CLASS<BR>'*+ Class constant
declaration<BR>'*- Class constants declaration</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=240483413-25062003><FONT face=Arial color=#0000ff size=2>'*+
Class variables declarations<BR>'*- Class variables
declarations</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=240483413-25062003><FONT face=Arial color=#0000ff size=2>'THESE
CONSTANTS AND VARIABLES ARE USED BY THE CLASS TO<BR>'IMPLEMENT CLASS
FUNCTIONALITY<BR>Private Declare Function apiGetTime Lib "winmm.dll"
_<BR>
Alias "timeGetTime" () As Long<BR>'*+ custom constants declaration<BR>'*- Custom
constants declaration</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=240483413-25062003><FONT face=Arial color=#0000ff size=2>'*+
custom variables declarations<BR>Dim lngStartTime As Long<BR>'*- custom
variables declarations</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=240483413-25062003><FONT face=Arial color=#0000ff size=2>'THESE
FUNCTIONS / SUBS ARE USED INTERNALLY TO THE CLASS<BR>'*+ Private Init/Terminate
Interface<BR>Private Sub Class_Initialize()<BR>
StartTimer<BR>End Sub<BR>'*- Public Init/Terminate interface<BR>'*- Parent/Child
links interface<BR>'THESE FUNCTIONS / SUBS ARE USED TO IMPLEMENT CLASS
FUNCTIONALITY<BR>'*+Class function / sub declaration<BR>Function EndTimer() As
Long<BR> EndTimer = apiGetTime() - lngStartTime<BR>End
Function</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=240483413-25062003><FONT face=Arial color=#0000ff size=2>Sub
StartTimer()<BR> lngStartTime = apiGetTime()<BR>End
Sub<BR>Function RawTime() As Long<BR> RawTime =
apiGetTime()<BR>End Function<BR>'*-Class function / sub
declaration<BR></FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<P><FONT size=2>John W. Colby<BR>www.colbyconsulting.com</FONT> </P>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B>
accessd-bounces@databaseadvisors.com
[mailto:accessd-bounces@databaseadvisors.com]<B>On Behalf Of </B>Rocky Smolin
- Beach Access Software<BR><B>Sent:</B> Tuesday, June 24, 2003 12:08
AM<BR><B>To:</B> AccessD@databaseadvisors.com<BR><B>Subject:</B> [AccessD]
Time in milliseconds<BR><BR></FONT></DIV>
<DIV><FONT face=Arial size=2>Dear List:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Is it possible to access/store/display the time
in increments smaller than seconds. I need to time something in
fractions of a second.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>MTIA</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Rocky</FONT></DIV>
<DIV> </DIV></BLOCKQUOTE></BODY></HTML>