Re: Monitoring Machine Running Time

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I agree, John; however, I think it would be good to make the OP aware of the
issues and options.

If the OP would like to convert the measurement to Furlongs per Fortnight, I
can provide that formula as well :)

("of course I'm mad, I've always been mad" - Pink Floyd/Dark Side of the Moon)
--
Dave Hargis, Microsoft Access MVP


"John Spencer" wrote:

Well since we are relying on users to note the start and stop time by
pressing a button on the screen, I don't think we really need to worry about
accuracy too much.

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

"Klatuu" <Klatuu@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:E2508DFB-8F63-4654-B3BE-8E0C00747406@xxxxxxxxxxxxxxxx
Depending on how granular you want the machine run time, I may not
necessarily agree with # 1. Depending on a lot of factors, the time for
the
form to open and establish the start time will vary. This could create
incorrect data. The "stop watch" idea of pushing a button to start the
timing may be more accurate.

Also, if the OP is looking for sub second timing, the form timer event may
have to be called in on this one.

Here is code for an API call that runs a very accurate timer to the
millisecond.

Option Compare Database
Option Explicit

Private Declare Function timeGetTime Lib "winmm.dll" () As Long

Private lngStartTime As Long

Public Sub StartTimer()
lngStartTime = timeGetTime()
End Sub

Public Function StopTimer() As Long
StopTimer = timeGetTime - lngStartTime
End Function


--
Dave Hargis, Microsoft Access MVP


"Albert D. Kallal" wrote:

"Tommy2326" <Tommy2326@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:1BBBE13A-B6F9-41BE-BED7-261BE7D32BD2@xxxxxxxxxxxxxxxx


yes, #1 is the way to go....

You don't need some "process" running. In fact you could even close the
form..and come back later, open the form, and hit the stop button.

in addition, you build a design in which several timers are going,
because
they are only records with a start time logged, and the time is
calculated
when you hit the stop button, and the "end time" is saved.....

So, this is very flexible, and you have not limit as to how many "timers"
running, since they are just start/end times in a table....


--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@xxxxxxx






.


Quantcast