jmeter函数之时间函数__time

新浪围脖>@o蜗牛快跑o   企鹅交流群>79642549


常用于带时间戳的地方

比如:带时间戳的结果文件,每次运行生成独立文件

${__time(,)}         1450056496991 //无格式化参数,返回当前毫秒时间
${__time(yyyyMMdd,)} 20151214      //返回年月日
${__time(HHmmss,)}   092816        //返回时分秒
${__time(yyyyMMdd-HHmmss,)} 20151214-092816 //全

官网原文:

19.5.17 __time

The time function returns the current time in various formats.

Parameters

Attribute Description Required
FormatThe format to be passed to SimpleDateFormat. The function supports various shorthand aliases, see below. If ommitted, the function returns the current time in milliseconds since the epoch.No
Name of variableThe name of the variable to set.No

If the format string is omitted, then the function returns the current time in milliseconds since the epoch. In versions of JMeter after 2.7, if the format matches "/ddd" (where ddd are decimal digits), then the function returns the current time in milliseconds divided by the value of ddd. For example, "/1000" returns the current time in seconds since the epoch. Otherwise, the current time is passed to SimpleDateFormat. The following shorthand aliases are provided:

  • YMD = yyyyMMdd
  • HMS = HHmmss
  • YMDHMS = yyyyMMdd-HHmmss
  • USER1 = whatever is in the Jmeter property time.USER1
  • USER2 = whatever is in the Jmeter property time.USER2

The defaults can be changed by setting the appropriate JMeter property, e.g. time.YMD=yyMMdd


  • 0
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值