DateDiff in milliseconds in Win XP PRO

S

Sogge

Hi there :)

I am using the DateDiff function to record the time of a specific task.

Ex:

DateDiff("s", TimeStarted, TimeFinished)

This function gives me total time in seconds. Is there a way to get time in
milliseconds. Seconds, doesn't give me the detail I need.

Remember - I'm using XP-Pro

Thanks in advance

Sogge
 
A

Arvin Meyer

You can use the GetTickCount Windows API

Private Declare Function apiGetTickCount Lib "kernel32" Alias "GetTickCount"
() As Long

Sub TestTick()
Dim lngStart As Long
Dim lngEnd As Long
Dim lngTest As Long

lngStart = apiGetTickCount()

DoEvents

lngEnd = apiGetTickCount()
lngTest = lngEnd - lngStart
Debug.Print lngTest

End Sub
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
Top