${__time(,)}的值总是被设置为后处理器第一次在while循环中运行时的时间值。代码:
if(${__time(,)} - vars.get("LoginTime").toLong() >
vars.get("AgentDuration").toLong())
{
vars.put("SendHeartbeat", "0")
log.info("C1 disconnected at: " + ${__time(,)}.toString())
}发布于 2019-06-17 13:36:35
不要在脚本中使用${}语法,使用getTime()而不是${__time(,)}
if(new Date().getTime() - vars.get("LoginTime").toLong() > vars.get("AgentDuration").toLong()) { https://stackoverflow.com/questions/56632218
复制相似问题