This code sets a global variable named 'timestamp_ms' with the value of the current timestamp in milliseconds.

pm.globals.set('timestamp_ms', Date.now());

The pm.globals.set() function sets a global variable within the Postman environment. The variable name is 'timestamp_ms', and the value is obtained using the Date.now() method, which returns the current timestamp in milliseconds since the Unix epoch (January 1, 1970, 00:00:00 UTC).

JavaScript: Setting a Global Timestamp Variable

原文地址: https://www.cveoy.top/t/topic/pgL6 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录