}
public void run() {
final int ITERATIONS = 1000000;
final String[] fields = new String[10000];
final StopWatch watch = new StopWatch();
watch.start();
for (int i=0; i<ITERATIONS; ++i) {
if (StringUtil.split(text, fields, '\t') > 100) {
System.out.println("Mama Mia that's a lot of tokens!!");
}
}
watch.stop();
System.out.println("StringUtil.split() took " + watch.getElapsedTime());
watch.reset();
watch.start();
for (int i=0; i<ITERATIONS; ++i) {
if (split(text, fields, "\t") > 100) {
System.out.println("Mama Mia that's a lot of tokens!!");
}
}
watch.stop();
System.out.println("StringTokenizer took " + watch.getElapsedTime());
}