loadrunner中“return 0 ” 的作用
Loadrunner 中提供了函数exit(-1)来结束迭代。 使用return 0 来结束本次迭代,进入下一次迭代。
例子:
1.使用return 0
int c=0;
Action()
{
c=c+1;
if (c==3) {
return 0;
}
lr_output_message("result is %d",c);
}
运行结果:
Action.c(9): result is 1
Action.c(9): result is 2
Action.c(9): result is 4
Action.c(9): result is 5
Vuser Terminated.
2.注释掉return 0
int c=0;
Action()
{
c=c+1;
if (c==3) {
//return 0; //return 0的作用
}
lr_output_message("result is %d",c);
}
运行结果:
Action.c(9): result is 1
Action.c(9): result is 2
Action.c(9): result is 3
Action.c(9): result is 4
Action.c(9): result is 5
Vuser Terminated.