Code Duplication    Length = 15-15 lines in 2 locations

src/MySqlDatabase.php 1 location

@@ 95-109 (lines=15) @@
92
		return $start;
93
	}
94
	
95
	public function getReadableTime($time) {
96
		$ret = $time;
97
		$formatter = 0;
98
		$formats = array('ms', 's', 'm');
99
		if($time >= 1000 && $time < 60000) {
100
			$formatter = 1;
101
			$ret = ($time / 1000);
102
		}
103
		if($time >= 60000) {
104
			$formatter = 2;
105
			$ret = ($time / 1000) / 60;
106
		}
107
		$ret = number_format($ret,3,'.','') . ' ' . $formats[$formatter];
108
		return $ret;
109
	}
110
	
111
	function __destruct()  {
112
		@mysql_close($this->conn);

src/PhpQuickProfiler.php 1 location

@@ 171-185 (lines=15) @@
168
	       return sprintf($retstring, $size, $sizestring);
169
	}
170
	
171
	public function getReadableTime($time) {
172
		$ret = $time;
173
		$formatter = 0;
174
		$formats = array('ms', 's', 'm');
175
		if($time >= 1000 && $time < 60000) {
176
			$formatter = 1;
177
			$ret = ($time / 1000);
178
		}
179
		if($time >= 60000) {
180
			$formatter = 2;
181
			$ret = ($time / 1000) / 60;
182
		}
183
		$ret = number_format($ret,3,'.','') . ' ' . $formats[$formatter];
184
		return $ret;
185
	}
186
	
187
	/*---------------------------------------------------------
188
	     DISPLAY TO THE SCREEN -- CALL WHEN CODE TERMINATING