添加一个BeanShell 前置处理器

在Script中写入下面脚本:

long nowTime =System.currentTimeMillis();
long todayStartTime =nowTime - ((nowTime + TimeZone.getDefault().getRawOffset()) % (24 * 60 * 60 * 1000L));
vars.put("time",String.valueOf(todayStartTime));

Jmeter 使用BeanShell 前置处理器,获取当天零点时间戳

该脚本的意义是获取当天零点的时间戳,然后传递给Jmeter的time变量。

相关文章:

  • 2022-12-23
  • 2021-11-18
  • 2022-12-23
  • 2021-08-22
  • 2021-11-18
  • 2022-02-17
猜你喜欢
  • 2022-12-23
  • 2021-07-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-01
  • 2021-11-18
相关资源
相似解决方案