Code example for TextView

Methods: append

0
		long i;
		String ret = "";
 
		switch(benchmark){
		case APPEND:
			//double the amount of test runs until the test take more than RUNNING_TIME to perform 
			for(i = 1; (time = this.appender(i, JAVA_LANG_STRING, 0)) < RUNNING_TIME; i*=2);
			ret += "appending " + ALOT*i + " java.lang.Strings to a java.lang.String in ";
			ret += "Time: " + time + " msecs, " + (float) (ALOT*i)/(float) time + " KSTROPS.\n";
 
			for(i = 1; (time = this.appender(i, JAVA_LANG_STRING, 1)) < RUNNING_TIME; i*=2);
			ret += "appending " + ALOT*i + " java.lang.Strings to a java.lang.String in";
			ret += "Time: " + time + " msecs, " + (float) (ALOT*i)/(float) time + " KSTROPS.\n";
			break; 
 
		case COPY:
			for(i = 1; (time = this.copy(i, JAVA_LANG_STRING)) < RUNNING_TIME; i*=2);
			ret += "copying " + ALOT*i + " java.lang.Strings to a java.lang.String in ";
			ret += "Time: " + time + " msecs, " + (float) (ALOT*i)/(float) time + " KSTROPS.\n";
			break;