????????????????????У???????????????????????????????????????????????????л??????Щ???????????????????????????????棬???????????=??????????+????????????????????????????????????LoadRunner??????????????????????????????????????????????????????£?
double time_elapsed = 0.00?? duration = 0.00?? waste = 0.00??trans_time = 0.00??waste_time = 0.00;
merc_timer_handle_t timer;
timer = lr_start_timer(); //timer???
if(strlen(lr_eval_string("{P_Bal}")) > 0)
{
for(i=0;i < strlen(lr_eval_string("{P_Bal}"));i++)
{
//lr_error_message("%d"??i);
lr_save_var(lr_eval_string("{P_Bal}")+i??1??0??"P_Value");
#define temp = 0;
//lr_error_message("%s"??lr_eval_string("{P_Value}"));
if(atoi(lr_eval_string("{P_Value}")) != 0)
{
if(strcmp(lr_eval_string("{P_Value}")??"??") != 0 && strcmp(lr_eval_string("{P_Value}")??".") != 0)
{
break;
}
}
}
}
time_elapsed = lr_end_timer(timer);//??timer
lr_output_message("%lf"??time_elapsed);
waste = time_elapsed * 1000; //?????????
if(lr_get_transaction_status("XXX") == 1 || atoi(lr_eval_string("{P_Value}")) <= 0)
{
lr_wasted_time(waste);//?????????????????????
lr_end_transaction("XXX"?? LR_FAIL);
lr_output_message("XXX??? %s %s"??lr_eval_string("{UserName}")??lr_eval_string("{P_AccountId}"));
goto exit;
}
???????′???
????????web_find???????е??????????????????????????У???Щ??ü???????????????????????lr_wasted_time???????????????????????п????
Action()
{
double time_elapsed;
merc_timer_handle_t timer;
lr_start_transaction("Search");
web_url("baidu_search"??
"url=http://www.baidu.com/s?wd=LoadRunner"??
"mode=html"??
LAST);
timer=lr_start_timer();//?????????????????????????
web_find("web_find"??"what=load"??LAST);
time_elapsed=lr_end_timer(timer);//???????????????time_elapsed???????λ????
lr_wasted_time(time_elapsed*1000);//lr_wasted_time??????????????????????*1000
lr_error_message("Find Time= %lf??wasted_time=%lf"??time_elapsed??lr_get_transaction_wasted_time("Search"));
lr_end_transaction("Search"??LR_AUTO);
return 0;
}