'Locust - There is a built-in way to get the test duration?

I would like to get the duration of the test I started. A possibility is to use the on_test_start and on_test_stop to set up a measurement in order to keep track of time, but I wanted to know if there was a "built-in" function created specifically to provide the duration. I know usually the duration is provided by the user but I would like to keep track of it directly in the script. In order to show it through an exported CSV file or through a Prometheus metric or a point in an InfluxDB.

I'm aware that the last two options aren't really suitable for this idea

Thank you for your suggestions



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source