html tool

2021年11月24日星期三

loadrunner 使用秒钟表示时间


long t;
time(&t);  //参考: https://blog.csdn.net/q11w2212/article/details/8474725
lr_save_int(t,"event_time"); // lr_save_string -h1
...
 web_custom_request("report_log",
              "URL=http://tq:9091/v1/log",
                       "Method=POST",
                       "Resource=0",
                       "RecContentType=text/html",
                       "Referer=",
                       "Mode=HTML",

                       "EncType=application/json",
					   "Body={\"event_time\":{event_time}}",
                       LAST)


参考:https://blog.csdn.net/q11w2212/article/details/8474725

Action()
{
    long t;
    time(&t);//获取当前时间
    lr_message("直接获取当前时间的结果是:%s",ctime(&t));
    return 0;
}

运行结果:直接获取当前时间的结果是:Wed Jul 04 14:01:39 2007

没有评论:

发表评论