how to check api response time in python