Example: lr_get_transaction_duration

This example shows the usage of the lr_get_transaction_duration function. With the necessary syntax changes, the same logic works in Java.

In this example lr_get_transaction_duration, checks the duration of part of a transaction, and sends it to the Output window.

double trans_time;
int status;
lr_start_transaction ("Flight");
          LAST );
 // Get transaction time to this point 
status = web_submit_data("flight",
          LAST );
 /* End transaction with operation result - pass or fail */
if (status == 0)
     lr_end_transaction("Flight", LR_PASS);
     lr_end_transaction("Flight", LR_FAIL);

if (trans_time)
     lr_output_message("The duration up to the submit is %f seconds", trans_time);
     lr_output_message("The duration cannot be determined.");