Share this page

# lr.get_transaction_think_time

Returns the think time of a transaction.

## JavaScript

    function lr.get_transaction_think_time(  transaction  )

## VBScript

    Function lr.get_transaction_think_time(  transaction  )

Transaction Functions

## Arguments

Name | Comments
--- | ---
transaction | The transaction name .

The lr.get_transaction_think_time function returns the think time of the specified transaction until this point. It returns values greater than zero only for open transactions.

To determine other transaction statistics, such as think time and wasted time, use the appropriate Transaction Functions.

## Return Values

On success, returns the transaction think time. On failure, returns a negative number. If the transaction already ended or if data is not available for the specified transaction, returns 0.

## Parameterization

Standard parameterization is not available for this function.

## VBScript Example

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")
    think_time=lr.get_transaction_think_time("Flight")
    lr.message "Think time = " + Cstr(think_time)

    'Output:

    'Think time = 5.0072

    lr.end_transaction "Flight", lr.AUTO

Example: Output:
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

Tips to improve your search results... VuGen Function Reference Version 26.1 Function Reference 26.1 All View Local Help Center View Online Help Center Version: