App Engine: Is time.sleep() counting towards my quotas?

Hey. I'm working on an App Engine app that involves queries to the Google Maps API for geocoding. Google Maps doesn't like too much requests so I put a 1 second delay between each request with time.sleep(1).

I noticed that my quotas are running low in my GAE dashboard and decided to run a short test:

import cProfile
import time

def foo():
    time.sleep(3)

cProfile.run('foo()')

Which gave me the following output:

   4 function calls in 3.003 CPU seconds
   Ordered by: standard name

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        1    0.000    0.000    3.003    3.003 <stdin>:1(foo)
        1    0.000    0.000    3.003    3.003 <string>:1(<module>)
        1    0.000    0.000    0.000    0.000 {method 'disable' of '_lsprof.Profiler' objects}
        1    3.003    3.003    3.003    3.003 {time.sleep}

So it says that it's consuming 3 CPU seconds for a time.sleep(3). Now I'm wondering if calls like these are counted towards the quota limits that GAE provides. And if it does, what is the other way of making delays between API calls for geocoding?

Thanks.

10
задан kovshenin 23 November 2010 в 09:47
поделиться