Skip to main content

Dial_GetCurrentTimestamp (function reference)

By November 1, 2020June 23rd, 2021Online Help, Troi Dialog Plug-in
Troi Dialog Plug-in > Functions reference > Dial_GetCurrentTimestamp
Troi Dialog Plug-in for FileMaker Pro

Dial_GetCurrentTimestamp

The function returns the current timestamp with extra precision, in milliseconds.

SyntaxFunction badge

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)


Online Help Page for Troi Dialog Plug-in for 16 to 19 –> Dial_GetCurrentTimestamp (dialp4318) 2021-0623 15:48:55