Industrademic
Industrademic

Reputation: 127

millisecond time in ahk

I'm looking for a way to save timestamps to the millisecond in ahk.

FormatTime, stamp, , HH:mm:ss
        FileAppend,
        (
            %stamp%,`n 
        ), C:\%thefilename%.txt

The above code only provides time to the second. My events sometimes take place twice a second. Can ahk provide this level of detail?

Upvotes: 2

Views: 2615

Answers (3)

Reasel
Reasel

Reputation: 93

Something like:

startTime := %A_TickCount%

;Do your things

elapsedTime := startTime - %A_TickCount%

Should do the trick to get ms time.

Upvotes: 0

Grey
Grey

Reputation: 339

FileAppend,
(
   %A_Hour%:%A_Min%:%A_Sec% (%A_MSec%),`n
), C:\%thefilename%.txt

Upvotes: 3

Robert Ilbrink
Robert Ilbrink

Reputation: 7953

Have you looked at using the internal %A_TickCount% (approx. ms accuracy) variable to create an Elapsed Time value between two timing points?

Upvotes: 2

Related Questions