Answer the question
In order to leave comments, you need to log in
How to speed up getting data from the API?
1. The user entered id .
2. I make a request to the API of another service with the id etip .
3. For example, I get the total number of records 19000.
Now I need to go through each record from these 19000, get the value of this record and then determine the maximum value from these 19000.
API for one request gives a maximum of 200 records.
I did this:
1. Loop for from 1 to 19000/200
2. For each pass of the loop, write the maximum value out of 200 to the array.
3. When the for has reached the end, select the maximum value from the written array.
Works but takes a long time.
How can this be improved or should it be done differently?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question