Dial_GetCurrentTimestamp |
The function returns the current timestamp with extra precision, in milliseconds.
Syntax
Dial_GetCurrentTimestamp ( switches )
Parameters
switches | not used, reserved for future use. Leave blank or put "-unused" |
Returned Result
Data type returned
Timestamp
Result
If successful it returns a Timestamp value, like for example: 12/10/2017 11:42:42,596492
Originated in
Troi Dialog Plug-in 5.0
Compatibility
FileMaker Pro 16 to 19
Considerations
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.
Example
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.
Example 2
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 ]
Used in example file
MilliSeconds.fmp12
Related topics
Troi Dialog Plug-in online help (overview)