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

@@ 201-215 (lines=15) @@
198
	       return sprintf($retstring, $size, $sizestring);
199
	}
200
	
201
	public function getReadableTime($time) {
202
		$ret = $time;
203
		$formatter = 0;
204
		$formats = array('ms', 's', 'm');
205
		if($time >= 1000 && $time < 60000) {
206
			$formatter = 1;
207
			$ret = ($time / 1000);
208
		}
209
		if($time >= 60000) {
210
			$formatter = 2;
211
			$ret = ($time / 1000) / 60;
212
		}
213
		$ret = number_format($ret,3,'.','') . ' ' . $formats[$formatter];
214
		return $ret;
215
	}
216
	
217
	/*---------------------------------------------------------
218
	     DISPLAY TO THE SCREEN -- CALL WHEN CODE TERMINATING