Your webservice has a microflow processing the request, doing its duty and preparing the response. Measure the difference between the start of that microflow and you know the time it takes to process the request. This does not take into account the time it takes for the call to travel between the client and the server.
If you want end-to-end response time, you need to register the times at the caller's side. Often the webclient. So you need to add logic at the microflow calling the webservice and handling the response.
If you just want to know how long the request took without processing the response, you can indeed add timestamps before and after the call and calculate the time between. See https://docs.mendix.com/refguide/between-date-function-calls how to do the calculation.