function formatTime($seconds) {
		switch (true) {
			case $seconds == 0:
				return 0;
			
			case $seconds < 0.01:
				$time = round($seconds * 1000, 2) . 'ms';
				break;
			
			case $seconds < 0.1:
				$time = round($seconds * 1000, 1) . 'ms';
				break;
			
			case $seconds < 1:
				$time = round($seconds * 1000) . 'ms';
				break;
			
			case $seconds < 10:
				$time = round($seconds, 2) . 's';
				break;
			
			default:
				$time = round($seconds, 1) . 's';
		}
		
		return $time;
	}