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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top