So I'm by no means an expert to programming, in fact Torn's API is the first time I've made a program that interacts with something other than itself (and maybe a text document).
Anyway, the programs I've been experimenting with tend to be batch processing sort of work, i.e. read a bunch of information from a file, get the appropriate data from Torn and present it when done.
This obviously leads to a large amount of API calls and I just passed the rite of passage of making too many requests.
How could I incorporate a cap into my program?
I'm expecting I'd use a global variable to hold the calls count and a function to sleep if calls > max allowed; but how would you balance this with the time, and if it's safe to start running again?
TL;DR: How would I prevent my code from exceeding the API call limit since it will be making a lot of calls as fast as possible.