Example: lr.get_transaction_think_time

This example shows think_time used in an action and also in a sub-routine, YourApiCall, called by that action. get_transaction_think_time is called at the end of the action. The result reflects the total think time both in the main action and in the sub-routine.

Public Function Action() As Long
Dim rc As Integer
Dim think_time as Double

lr.start_transaction "Flight"
lr.think_time 3
' Call the API of your application to see whether the purchase is registered. 
rc = YourApiCall (s_code, "EdmundBertam")
lr.message "Think time = " + Cstr(think_time)
'Think time = 5.0072
lr.end_transaction "Flight", lr.AUTO
Notify: Transaction Flight ended with Pass status (Duration: 5.5580 Think Time: 5.0072).
Action = lr.PASS
End Function
Function YourApiCall(i As Integer, char As String) As Integer

Dim x As Integer
lr.think_time 2
YourApiCall = x
End Function