Calculate the duration of API calls + calculation