UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

> Time.. Hours.. Minutes.. Seconds.. Milliseconds?    
 
   
Coldbrain
post Jan 9 2007, 05:06 PM
Post #1

UtterAccess Veteran
Posts: 484
From: Florida



Is there a way to format a time with milliseconds? I am working on a project for a friend with racing and he wants his lap times with milliseconds because many of the times are very close.. Seems silly but I can't seem to find it.. perhaps I am just supposed to construct it and decontruct if I want to perform any math on them?

CB
Go to the top of the page
 
+
 
Start new topic
Replies
r_cubed
post Jan 9 2007, 07:53 PM
Post #2

UtterAccess VIP
Posts: 3,752
From: Australia (NSW)



Try the following code , which like Brent uses an API call, but also has subroutines for 'StartINg' and 'Stopping' with the 'STOP calculating the elapsed time in millisecs.


CODE
Public Declare Function adh_apiGetTime Lib "winmm.dll" _
            Alias "timeGetTime" () As Long

Global lngStartTime As Long
'

'
'
Sub adhStartTimer()
    ' Start the timer, storing the value in
    ' the module global, lngStartTime.
    
    lngStartTime = adh_apiGetTime()
End Sub
'
'


Function adhEndTimer() as Long
    ' End timing, and return the difference between the
    ' current time and lngStartTime
        
    adhEndTimer = adh_apiGetTime() - lngStartTime
    
End Function
Go to the top of the page
 
+

Posts in this topic


Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 21st May 2013 - 07:02 PM