public static function time($key = null) {

		if(null !== $key && false === is_string($key)) {
 			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($key)), E_USER_ERROR);
		}

		if(count(static :: $time) === 0) {
			static :: $time = [];
		}

		if(null !== $key) {
			
			static :: $time[] = ['time' => microtime(), 'key' => $key];
			return;
		}

		static :: $time[] = ['time' => microtime(), 'key' => 'end'];
		
		$laps = [];

		for($i = 1; $i < count(static :: $time); $i++) {

			$start 	= explode(' ', static :: $time[$i - 1]['time']);
			$end  	= explode(' ', static :: $time[$i]['time']);

			$laps[static :: $time[$i - 1]['key'] . ' - ' . static :: $time[$i]['key']] = number_format((($end[1] + $end[0]) - ($start[1] + $start[0])), 4, '.', '');
		}

		return $laps;
	}
public static function time($key = null) {

		if(null !== $key && false === is_string($key)) {
 			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($key)), E_USER_ERROR);
		}

		if(count(static :: $time) === 0) {
			static :: $time = [];
		}

		if(null !== $key) {
			
			static :: $time[] = ['time' => microtime(), 'key' => $key];
			return;
		}

		static :: $time[] = ['time' => microtime(), 'key' => 'end'];
		
		$laps = [];

		for($i = 1; $i < count(static :: $time); $i++) {

			$start 	= explode(' ', static :: $time[$i - 1]['time']);
			$end  	= explode(' ', static :: $time[$i]['time']);

			$laps[static :: $time[$i - 1]['key'] . ' - ' . static :: $time[$i]['key']] = number_format((($end[1] + $end[0]) - ($start[1] + $start[0])), 4, '.', '');
		}

		return $laps;
	}
public static function time ( $ key = null ) { if ( null !== $ key && false === is_string ( $ key ) ) { return trigger_error ( sprintf ( 'Argument 1 passed to %s() must be of the type string, "%s" given' , __METHOD__ , gettype ( $ key ) ) , E_USER_ERROR ) ; } if ( count ( static :: $ time ) === 0 ) { static :: $ time = [ ] ; } if ( null !== $ key ) { static :: $ time [ ] = [ 'time' => microtime ( ) , 'key' => $ key ] ; return ; } static :: $ time [ ] = [ 'time' => microtime ( ) , 'key' => 'end' ] ; $ laps = [ ] ; for ( $ i = 1 ; $ i < count ( static :: $ time ) ; $ i ++ ) { $ start = explode ( ' ' , static :: $ time [ $ i - 1 ] [ 'time' ] ) ; $ end = explode ( ' ' , static :: $ time [ $ i ] [ 'time' ] ) ; $ laps [ static :: $ time [ $ i - 1 ] [ 'key' ] . ' - ' . static :: $ time [ $ i ] [ 'key' ] ] = number_format ( ( ( $ end [ 1 ] + $ end [ 0 ] ) - ( $ start [ 1 ] + $ start [ 0 ] ) ) , 4 , '.' , '' ) ; } return $ laps ; }
Calculate process times by adding new times an exporting them
@param string $key
@return array
Calculate process times by adding new times an exporting them