Exemplo n.º 1
0
 /**
  * Makes sure the necessary amount of time has passed since the last
  * geocoding request.
  *
  * @return void
  */
 protected function throttle()
 {
     if (self::$lastGeocodingTimestamp > 0.0) {
         $secondsSinceLastRequest = microtime(TRUE) - self::$lastGeocodingTimestamp;
         if ($secondsSinceLastRequest < self::GEOCODING_THROTTLING) {
             usleep(1000000 * (self::GEOCODING_THROTTLING - $secondsSinceLastRequest));
         }
     }
     self::$lastGeocodingTimestamp = microtime(TRUE);
 }