# eMQTT-Bench 工具发布消息

**URL:** <https://askemq.com/t/topic/11076>\
**Category:** 性能问题\
**Tags:** 技术支持, 社区活动\
**Created:** [2025 年3 月 22 日 07:46 UTC](https://askemq.com/t/topic/11076 "2025-03-22T07:46:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

作者： ![LGC](https://askemq.com/letter_avatar/lgc/32/6_449c533f586939b6e5f246632a46421f.png) [@LGC](https://askemq.com/u/LGC)\
发布日期： [2025 年3 月 22 日 07:46 UTC](https://askemq.com/t/topic/11076/1 "2025-03-22T07:46:54Z")

</div>

利用 eMQTT-Bench 工具发布消息，发现支持-m 指定发布的消息内容，请问如何时%TIMESTAMPMS%。  
-m, --message Set the message content for publish. Either a literal message content,  
or path to a file with payload template specified via  
‘template://\<file\_path\>’. Available variables: %TIMESTAMP%,  
%TIMESTAMPMS%, %TIMESTAMPUS%, %TIMESTAMPNS%, %UNIQUE%, %RANDOM%. When  
using ‘template://’, --size option does not have effect except for when  
%RANDOM% placeholder is used.

---

<div class="post-metadata">

作者： ![LGC](https://askemq.com/letter_avatar/lgc/32/6_449c533f586939b6e5f246632a46421f.png) [@LGC](https://askemq.com/u/LGC)\
发布日期： [2025 年3 月 22 日 07:59 UTC](https://askemq.com/t/topic/11076/2 "2025-03-22T07:59:21Z")

</div>

./emqtt\_bench pub -h {EMQX\_IP} -p 1883 -t “test/qos0” -q 0 -c 10 -I 1000 -m “{"ts":%TIMESTAMP%}” 中占位符无法生效
