The function returns the current timestamp with extra precision, in milliseconds.
Dial_GetCurrentTimestamp ( switches )
|switches||not used, reserved for future use. Leave blank or put "-unused"|
Data type returned
If successful it returns a Timestamp value, like for example: 12/10/2017 11:42:42,596492
Troi Dialog Plug-in 5.0
FileMaker Pro 12 to 17
Although the result includes milliseconds, the actual precision might be less, due to specifics of the computer etc. Also FileMaker may be needing variable amounts of time before returning the result. Our test shows you can expect a precision of about 1/100th of a second.
Dial_GetCurrentTimestamp ( "-Unused" )
This will return a timestamp of the current time. The result can be for example: 11/12/2017 11:42:42,596492. Note the extra fraction value after the comma.
This example demonstrates how you can measure the difference in time between 2 scripts, which perform the same action, but are implemented differently. We assume that in your FileMaker file the following fields are defined:
Duration Testscript1 Global, timestamp Duration Testscript2 Global, timestamp
Add the following script steps:
#Save the start time: Set Variable [ $StartTimestamp ; Dial_GetCurrentTimestamp ( "-Unused" ) ] Perform Script [ Efficiency Testscript1 ] Set Field [ Duration Testscript1 ; Dial_GetCurrentTimestamp ( "-Unused" ) - $StartTimestamp ] #Now do test 2: #Save the start time: Set Variable [ $StartTimestamp ; Value:Dial_GetCurrentTimestamp ( "-Unused" ) ] Perform Script [ Efficiency Testscript2 ] Set Field [ Duration Testscript2 ; Dial_GetCurrentTimestamp ( "-Unused" ) - $StartTimestamp ]