public static void testBoolean() {
final int count = 110000000;
long beginTime = System.currentTimeMillis();
for( int c = 0; c < count; c++) {
if( c % 2 == 0) {
}
}
System.out.println("Cost Time:" + (System.currentTimeMillis() - beginTime));
beginTime = System.currentTimeMillis();
boolean newPage = true;
for( int d = 0; d < count; d++) {
if( newPage) {
}
newPage = !newPage;
}
System.out.println("Cost Time:" + (System.currentTimeMillis() - beginTime));
}
public static void testInt() {
final int count = 1100000000;
final int mark = 2;
long beginTime = System.currentTimeMillis();
for( int c = 0; c < count; c++) {
switch( c % mark) {
case 0:
break;
case 1:
break;
case 2:
break;
case 3:
break;
case 4:
break;
}
}
System.out.println("Cost Time:" + (System.currentTimeMillis() - beginTime));
beginTime = System.currentTimeMillis();
int cur = 0;
for( int d = 0; d < count; d++) {
switch( cur) {
case 0:
break;
case 1:
break;
case 2:
break;
case 3:
break;
case 4:
break;
}
cur = ++cur < mark ? cur : 0;
/*cur++;
if( !(cur < mark)) {
cur = 0;
}*/
}
System.out.println("Cost Time:" + (System.currentTimeMillis() - beginTime));
}