Determines whether the display should be updated or not according to
our interval setting.

@return boolean  `true` if the display should be updated, `false` otherwise.
779446
public function shouldUpdate() {
		$now = microtime(true) * 1000;

		if (empty($this->_timer)) {
			$this->_start = (int)(($this->_timer = $now) / 1000);
			return true;
		}

		if (($now - $this->_timer) > $this->_interval) {
			$this->_timer = $now;
			return true;
		}
		return false;
	}
563345
public function check()
    {
        $this->notify(Status::CHECK, $this->loaded);
        $envArgs = explode('|', (string) getenv($this->envAllowXdebug));

        if (empty($envArgs[0]) && $this->requiresRestart((bool) $this->loaded)) {
            // Restart required
            $this->notify(Status::RESTART);

            if ($this->prepareRestart()) {
                $command = $this->getCommand();
                $this->notify(Status::RESTARTING, $command);
                $this->restart($command);
            }
            return;
        }

        if (self::RESTART_ID === $envArgs[0] && count($envArgs) === 5) {
            // Restarting, so unset environment variable and use saved values
            $this->notify(Status::RESTARTED);

            Process::setEnv($this->envAllowXdebug);
            self::$inRestart = true;

            if (!$this->loaded) {
                // Skipped version is only set if xdebug is not loaded
                self::$skipped = $envArgs[1];
            }

            // Put restart settings in the environment
            $this->setEnvRestartSettings($envArgs);
            return;
        }

        $this->notify(Status::NORESTART);

        if ($settings = self::getRestartSettings()) {
            // Called with existing settings, so sync our settings
            $this->syncSettings($settings);
        }
    }
906827
public function isNotYetValid()
    {
        $date = $this->getValidFrom();

        if ($date instanceof \MUtil_Date) {
            return $date->isLaterOrEqual(time());
        }

        return true;
    }
449613
def _update_display(self, event=None):
        """"""
        try:
            if self._showvalue:
                self.display_value(self.scale.get())
            if self._tickinterval:
                self.place_ticks()
        except IndexError:
            # happens when configure is called during a orientation change
            # because self.ticks is empty
            pass
1125768
protected function check()
  {
    if ( $this->slugAble() ){
      if ( !$this->checkTitleUnique($this->row->get('id'), $this->row->get('title')) ){
        return false;
      }
      
      if ( !$this->checkSlugUnique($this->row->get('id'), $this->row->get('slug')) ){
        return false;
      }
    }
    
    if ( $this->orderingAble() ){
      if ( $this->shouldBeOrdered() ){
        $conditions = $this->getReorderConditions();
        $this->row->set('ordering', $this->getNextOrder($conditions));
      }
    }
    
    if ( $this->statesAble() ){
      $userId   = $this->db->getUid();
      $nullDate = $this->db->getNullDate();
      $nowDate  = Date::getInstance()->format($this->db->getDateFormat());
      
      if ( !$this->row->get($this->tbl_key) ){
        $this->row->set('created', $nowDate);
        $this->row->set('created_by', $userId); 
      }
      else {
        $this->row->set('modified', $nowDate);
        $this->row->set('modified_by', $userId); 
      }
    }
    
    if ( $this->versionAble() ){
      $version = (int)$this->row->get('version');
      $this->row->set('version', ++$version);
    }
    
    foreach($this->getFields() as $fieldName => $fieldInfos){
      $v = $this->row->get($fieldName);
      
      if ( 'YES' === $fieldInfos->Null ){
        switch($fieldInfos->Type){
          case 'bigint':
          case 'mediumint':
          case 'smallint':
          case 'tinyint':
            if ( 0 === $this->row->get($fieldName) ){
              $this->row->set($fieldName, null);
            }
            break;
          
          case 'datetime':
          case 'timestamp':
            if ( $this->db->getNullDate(true) === $this->row->get($fieldName) ){
              $this->row->set($fieldName, null);
            }
            break;
          
          case 'date':
            if ( $this->db->getNullDate(false) === $this->row->get($fieldName) ){
              $this->row->set($fieldName, null);
            }
            break;
          
          case 'time':
            if ( '00:00:00' === $this->row->get($fieldName) ){
              $this->row->set($fieldName, null);
            }
            break;
        }
      }
    }
    
    return true;
  }
1225124
public function hasChanged(): bool
    {
        return ! (empty($this->addAttributes) && empty($this->updateAttributes) && empty($this->removeAttributes));
    }
343526
public function isUpdated($property = null)
    {
        if (null === $property) {
            return (count($this->updated) > 0);
        }

        return (isset($this->updated[$property]) && $this->updated[$property] === true);
    }
603657
def _need_update(self):
        ''
        if self.currval >= self.next_update or self.finished: return True

        delta = time.time() - self.last_update_time
        return self._time_sensitive and delta > self.poll
991010
public function shouldDisplay(): bool
    {
        if ($this->before || $this->after) {
            return true;
        }

        return (bool) count($this->children);
    }
696518
protected function checkAge()
    {
        $this->_is_old = false;

        switch ($this->_browser_name) {
            case 'Opera':
                if ($this->_version < 10)
                    $this->_is_old = true;
                break;
            case 'Firefox':
            case 'Iceweasel':
                if ($this->_version < 3)
                    $this->_is_old = true;
                break;
            case 'Safari':
                if ($this->_version < 5)
                    $this->_is_old = true;
                break;
            case 'Chrome':
                if (version_compare($this->_version, 5, '<'))
                    $this->_is_old = true;
                break;
            case 'iPhone':
            case 'iPod':
                $this->_is_old = true;
                break;
        }
    }
1055321
public function is_active() {

		if ( ! empty( $this->struct['screen'] ) && ! in_array( $this->screen->id, (array) $this->struct['screen'] ) ) {
			return false;
		}

		return parent::is_active();
	}
234279
@Override
  public boolean isModified()
  {
    long now = CurrentTime.currentTime();
    long lastCheckTime = _lastCheckTime.get();
    
    if (now <= lastCheckTime + _checkInterval) {
      return _isModified;
    }

    if (! _lastCheckTime.compareAndSet(lastCheckTime, now)) {
      return _isModified;
    }

    if (isModifiedImpl()) {
      _isModified = true;
      //_lastCheckTime.set(0);
    }
    else {
      _isModified = false;
    }

    return _isModified;
  }
1311509
public function isPing()
    {
        $nowTime = time();
        // 心跳间隔时间
        $pingInteralTime = RabbitMqConfig::getCommon('rabbit_mq_ping_interval_time');
        if ($this->lastPingTime + $pingInteralTime < $nowTime) {
            $this->lastPingTime = $nowTime;
            return true;
        }
        return false;
    }
1023915
public function should_show_for_user() {
        if (!$this->is_enabled()) {
            // The tour is disabled - it should not be shown.
            return false;
        }

        if ($tourcompletiondate = get_user_preferences(self::TOUR_LAST_COMPLETED_BY_USER . $this->get_id(), null)) {
            if ($tourresetdate = get_user_preferences(self::TOUR_REQUESTED_BY_USER . $this->get_id(), null)) {
                if ($tourresetdate >= $tourcompletiondate) {
                    return true;
                }
            }
            $lastmajorupdate = $this->get_config('majorupdatetime', time());
            if ($tourcompletiondate > $lastmajorupdate) {
                // The user has completed the tour since the last major update.
                return false;
            }
        }

        return true;
    }
695693
def is_updated(self):
        

        if not self.is_published:
            return False

        return sanitize_date(self.sys['published_at']) < sanitize_date(self.sys['updated_at'])
700612
protected function isPreviewDisplayable()
    {
        $image_area = $this->width * $this->height;
        $preview_area = $this->preview_width * $this->preview_height;

        $difference = ($preview_area - $image_area) / $image_area;

        return $this->preview_image != '' &&
            ($this->show_preview_when_smaller || $difference >= 0.2);
    }
1161612
public function hasChange()
    {
        return !is_null($this->resource) && ($this->resource->hasFields() || $this->resource->hasIndexes());
    }