Compute Elapsed TIme to 1/10th or 1/00th of a second

I'm experiencing some slow processing with an app when it runs in Access 2013.  Versions prior to 2013 are fine.  To find the bottleneck I want to put a timing log in the app.  I have a routine that will calculate the difference between two times down to the second but I need to me more granular than that to find out where my bottleneck is:  Does anyone have a routine that will calculate the difference between two times to a 10th or even 100th of a second?

Here's my current routine used to post processing information on the screen for long running processes:

Public Function RunTime(passedStartTime As Date, passedCurrTime As Date) As String
'
Dim lngHours As Long
Dim lngSeconds As Long
Dim lngMinutes As Long
Dim txtSeconds As Long
Dim txtMinutes As Long

lngSeconds = DateDiff("s", passedStartTime, passedCurrTime)
'
lngHours = Int(lngSeconds / 3600)
lngSeconds = lngSeconds - (lngHours * 3600)
lngMinutes = Int(lngSeconds / 60)
lngSeconds = lngSeconds - (lngMinutes * 60)
'
txtMinutes = Trim(Str(lngMinutes))
txtSeconds = Trim(Str(lngSeconds))
'
RunTime = "Elapsed Time = " & lngHours & " Hour(s), " & txtMinutes & " Minute(s) and " & txtSeconds & " Second(s)"
'



End Function

Open in new window


It returns a string (xx Hours, xx Minutes, xx Seconds).  I would like to go to the 1/10th or 100/th of a second difference
LVL 1
mlcktmguyAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rey Obrero (Capricorn1)Commented:
try using the Cdbl() function

cdbl(passedCurrTime) - cdbl(passedStartTime)

the first thre digit after the . (period) gives you the hour and minutes, the fourth digit to te end is your second/milliseconds
0
Gustav BrockCIOCommented:
You can use function Timer to get the count of seconds from Midnight with 1/18 second resolution.

/gustav
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mlcktmguyAuthor Commented:
This Timer was granular enough to track differences as the code executed.  In many case the Cdbl approach calculated a time difference of 0 between steps.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.