Sleep in non-GAE Environments says "Do other things and check back on me in
X time"
With instance Hour billing Sleep would only save you money if you have
concurrency to handle multiple tasks, and this freed CPU Cycles, AND you
weren't sleeping longer than the thing you were waiting to have happe
If you delete many entities it's faster to use a cursor. An entity is
marked as deleted and will physically be removed in the datastore at a
later time. It takes time to skip the marked entities when executing a
query.
The loop can be modified as such, no need to use count() as it uses
CPU and time