mirror of
				https://github.com/librenms/librenms.git
				synced 2024-10-07 16:52:45 +00:00 
			
		
		
		
	Merge pull request #2719 from SaaldjorMike/del-utime-func
Replaced custom utime() function with microtime(true)
This commit is contained in:
		@@ -135,7 +135,7 @@ function poll_device($device, $options) {
 | 
			
		||||
 | 
			
		||||
    $status = 0;
 | 
			
		||||
    unset($array);
 | 
			
		||||
    $device_start = utime();
 | 
			
		||||
    $device_start = microtime(true);
 | 
			
		||||
    // Start counting device poll time
 | 
			
		||||
    echo $device['hostname'].' '.$device['device_id'].' '.$device['os'].' ';
 | 
			
		||||
    if ($config['os'][$device['os']]['group']) {
 | 
			
		||||
@@ -253,7 +253,7 @@ function poll_device($device, $options) {
 | 
			
		||||
            }
 | 
			
		||||
        }//end if
 | 
			
		||||
 | 
			
		||||
        $device_end  = utime();
 | 
			
		||||
        $device_end  = microtime(true);
 | 
			
		||||
        $device_run  = ($device_end - $device_start);
 | 
			
		||||
        $device_time = substr($device_run, 0, 5);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -14,7 +14,7 @@ if ($device['os_group'] == 'unix') {
 | 
			
		||||
        $config['unix-agent']['read-timeout'] = $config['unix-agent-read-time-out'];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    $agent_start = utime();
 | 
			
		||||
    $agent_start = microtime(true);
 | 
			
		||||
    $agent       = fsockopen($device['hostname'], $agent_port, $errno, $errstr, $config['unix-agent']['connection-timeout']);
 | 
			
		||||
 | 
			
		||||
    // Set stream timeout (for timeouts during agent  fetch
 | 
			
		||||
@@ -36,7 +36,7 @@ if ($device['os_group'] == 'unix') {
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    $agent_end  = utime();
 | 
			
		||||
    $agent_end  = microtime(true);
 | 
			
		||||
    $agent_time = round(($agent_end - $agent_start) * 1000);
 | 
			
		||||
 | 
			
		||||
    if (!empty($agent_raw)) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user