Example: lr.get_transaction_duration

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");
web.url("home;sz=234x60;tile=1;ord=977672495775323400",
	"URL=http://ad.doubleclick.net/...ord=977672495775323400", new String[] {
	"Mode=URL",
	 web.LAST});
		
	// Get transaction time to this point 
trans_time=lr.get_transaction_duration("Flight");
status = web.submit_data("flight",
		"Action=http://www.Web-tours.com/cgi-bin/tours?ITN_RESPONSE+", new String[] {
		"Method=POST",
		"TargetFrame=",  
		web.LAST}, new String[] {
		"MY DATA",
		//...
		web.LAST}); 
 // End transaction with operation result - pass or fail /
if (status == 0)
     lr.end_transaction("Flight", lr.PASS);
else
     lr.end_transaction("Flight", lr.FAIL);

if (trans_time > 0)
     lr.output_message("The duration up to the submit is" + trans_time + "seconds.");
else
     lr.output_message("The duration cannot be determined.");