UpTime
time the system is running

@return void
8551
private function _uptime()
    {
        $result = 0;
        date_default_timezone_set('UTC');
        $buffer = $this->_get_Win32_OperatingSystem();
        if ($buffer && ($buffer[0]['LastBootUpTime'] !== null)) {
            $local = $buffer[0]['LocalDateTime'];
            $boot = $buffer[0]['LastBootUpTime'];

            $lyear = intval(substr($local, 0, 4));
            $lmonth = intval(substr($local, 4, 2));
            $lday = intval(substr($local, 6, 2));
            $lhour = intval(substr($local, 8, 2));
            $lminute = intval(substr($local, 10, 2));
            $lseconds = intval(substr($local, 12, 2));
            $loffset = intval(substr($boot, 21, 4));

            $byear = intval(substr($boot, 0, 4));
            $bmonth = intval(substr($boot, 4, 2));
            $bday = intval(substr($boot, 6, 2));
            $bhour = intval(substr($boot, 8, 2));
            $bminute = intval(substr($boot, 10, 2));
            $bseconds = intval(substr($boot, 12, 2));
            $boffset = intval(substr($boot, 21, 4));

            if (version_compare($buffer[0]['Version'], "5.1", "<")) { // fix LastBootUpTime on Windows 2000 and older
                $boffset += $boffset;
            }

            $localtime = mktime($lhour, $lminute, $lseconds, $lmonth, $lday, $lyear) - $loffset*60;
            $boottime = mktime($bhour, $bminute, $bseconds, $bmonth, $bday, $byear) - $boffset*60;

            $result = $localtime - $boottime;

            $this->sys->setUptime($result);
        } elseif (($this->sys->getDistribution()=="ReactOS") && CommonFunctions::executeProgram('uptime', '', $strBuf, false) && (strlen($strBuf) > 0) && preg_match("/^System Up Time:\s+(\d+) days, (\d+) Hours, (\d+) Minutes, (\d+) Seconds/", $strBuf, $ar_buf)) {
            $sec = $ar_buf[4];
            $min = $ar_buf[3];
            $hours = $ar_buf[2];
            $days = $ar_buf[1];
            $this->sys->setUptime($days * 86400 + $hours * 3600 + $min * 60 + $sec);
        }
    }
581993
public function getModificationTime() {

		if(false !== $this -> file -> getExists()) {

			$this -> refresh();
			
			return $this -> file -> getModificationTime();
		}
	}
308214
protected function uptimeInSeconds($date)
    {
        return
            (isset($date['up_days']) ? $date['up_days'] * 24 * 60 : 0) +
            (isset($date['up_hours']) ? $date['up_hours'] * 60 : 0) +
            (isset($date['up_minutes']) ? $date['up_minutes'] : 0);
    }
1353361
public function run()
    {
        $stime = microtime(true);
        $this->header('Content-Type: text/html; charset=utf-8');
        ?>
        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
            "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
        <html xmlns="http://www.w3.org/1999/xhtml">
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
            <title>Server status.</title>
        </head>
        <body>
        <br/>Uptime: <b><?php echo DateTime::diffAsText(Daemon::$startTime, time());
            ?></b>
        <br/><br/><b>State of workers:</b><?php $stat = Daemon::getStateOfWorkers();
        ?>
        <br/>Idle: <?php echo $stat['idle'];
        ?>
        <br/>Busy: <?php echo $stat['busy'];
        ?>
        <br/>Total alive: <?php echo $stat['alive'];
        ?>
        <br/>Shutdown: <?php echo $stat['shutdown'];
        ?>
        <br/>Pre-init: <?php echo $stat['preinit'];
        ?>
        <br/>Wait-init: <?php echo $stat['waitinit'];
        ?>
        <br/>Init: <?php echo $stat['init'];
        ?>
        <br/>
        <br/>Request took: <?php printf('%f', round(microtime(true) - $stime, 6));
        ?>
        </body>
        </html>
        <?php
    }
711600
def boot_time
      raw = procfs_file("uptime") { |file| file.read }
      Time.now - raw.split(/\s/).first.to_f
    end
448664
public function  setup() {
		parent::setup();
		increase_time_limit_to();

		$restart = $this->currentStep == 0;

		if (!$this->tempFile || !file_exists($this->tempFile)) {
			$tmpfile = tempnam(getTempFolder(), 'postsitemap');
			if (file_exists($tmpfile)) {
				$this->tempFile = $tmpfile;
			}
			$restart = true;
		}

		if ($restart) {
			$this->toProcess = $this->getProcessIds();
		}
	}
776483
function start(): void {
        if($this->nativeHrtime) {
            $this->timer = \hrtime(true);
        } elseif($this->hrtime) {
            $this->timer->start();
        } else {
            $this->timer = \microtime(true);
        }
    }
1238744
public function uses12HourClock()
    {
        if (is_null($this->use12HourClock)) {
            $this->use12HourClock = LanguagesManager::uses12HourClockForCurrentUser();
        }

        return $this->use12HourClock;
    }
218151
public static function init()
    {
        Daemon::$startTime = time();
        set_time_limit(0);

        Daemon::$defaultErrorLevel = error_reporting();
        Daemon::$restrictErrorControl = (bool)Daemon::$config->restricterrorcontrol->value;
        ob_start(['\PHPDaemon\Core\Daemon', 'outputFilter']);
        set_error_handler(['\PHPDaemon\Core\Daemon', 'errorHandler']);

        Daemon::checkSupports();

        Daemon::$initservervar = $_SERVER;
        Daemon::$masters = new Collection;
        Daemon::$shm_wstate = new ShmEntity(Daemon::$config->pidfile->value, Daemon::SHM_WSTATE_SIZE, 'wstate', true);
        Daemon::openLogs();
    }
735252
private function _uptime()
    {
        if (CommonFunctions::executeProgram('uptime', '', $buf)) {
            if (preg_match("/up (\d+) day[s]?,\s*(\d+):(\d+),/", $buf, $ar_buf)) {
                $min = $ar_buf[3];
                $hours = $ar_buf[2];
                $days = $ar_buf[1];
                $this->sys->setUptime($days * 86400 + $hours * 3600 + $min * 60);
            } elseif (preg_match("/up (\d+):(\d+),/", $buf, $ar_buf)) {
                $min = $ar_buf[2];
                $hours = $ar_buf[1];
                $this->sys->setUptime($hours * 3600 + $min * 60);
            }
        }
    }
325142
public function getUpTime()
    {

        // Time?
        if (!empty($this->settings['timer'])) {
            $t = new Timer('Uptime');
        }

        // Get contents
        $contents = Common::getContents('/proc/uptime', false);

        // eh?
        if ($contents === false) {
            Errors::add('Linfo Core', '/proc/uptime does not exist.');

            return 'Unknown';
        }

        // Seconds
        list($seconds) = explode(' ', $contents, 1);

        // Get it textual, as in days/minutes/hours/etc
        $uptime = Common::secondsConvert(ceil($seconds));

        // Now find out when the system was booted
        $contents = Common::getContents('/proc/stat', false);

        // Ugh
        if ($contents === false) {
            return $uptime;
        } // Settle for just uptime

        // Get date of boot
        if (preg_match('/^btime (\d+)$/m', $contents, $boot) != 1) {
            return $uptime;
        }

        // Okay?
        list(, $boot) = $boot;

        return array(
            'text' => $uptime,
            'bootedTimestamp' => $boot,
        );
    }
927371
protected function run()
    {
        $user = new User([
            'username'          => $this->get('username'),
            'group_id'          => $this->config->get('o_default_user_group'),
            'password'          => $this->get('password'),
            'email'             => $this->get('email'),
            'email_setting'     => $this->config->get('o_default_email_setting'),
            'timezone'          => $this->config->get('o_default_timezone'),
            'dst'               => $this->config->get('o_default_dst'),
            'language'          => $this->config->get('o_default_lang'),
            'style'             => $this->config->get('o_default_style'),
            'registration_ip'   => $this->get('ip'),
            //'last_visit'        => $this->request->server('REQUEST_TIME', time()),
        ]);

        $user->save();
        $this->raise(new UserHasRegistered($user));
    }
417218
public function bootEnv()
  {
    UpstartConfig::$environment = config('environment.required');
    UpstartConfig::$env         = config('app.dir') . '.env';
    UpstartConfig::$root        = config('app.dir');

    Env::start();
    date_default_timezone_set(env('APP_TIMEZONE', AppConfig::has('app.timezone') ? AppConfig::get('app.timezone') : 'UTC'));
  }
230220
protected function updateTimestamps()
    {
        $time = $this->freshTimestamp();

        if (! is_null($column = $this->getUpdatedAtColumn()) && ! $this->isDirty($column)) {
            $this->setAttribute($column, $time);
        }

        if (! $this->exists && ! is_null($column = $this->getCreatedAtColumn()) && ! $this->isDirty($column)) {
            $this->setAttribute($column, $time);
        }
    }
972367
public function timerUp() {
		if(!self::get('timer') || !self::get('timeout')) return false;
		return (time() - self::get('timeout') >= self::get('timer')) ? true : false;
	}
591698
public function before()
    {

        // ~ Init timer
        $this->time = - microtime(true);

        // ~ Reporting all error (default: all error) !
        error_reporting((int) $this->argument->get('error-reporting', null, - 1));
        ini_set('display_errors', (bool) $this->argument->get('error-display', null, 1));

        // ~ Set limit time to 0 (default: unlimited) !
        set_time_limit((int) $this->argument->get('time-limit', null, 0));

        $this->isVerbose = ! $this->argument->has('quiet');
    }
355425
public static function start()
    {

        static::$time = microtime(true);
        static::$memory = memory_get_usage(true);

        self::log(static::$time, _t("Start execution time"), "info");
    }