{
//*-- create a thread to build the index and start it.
monitor.beginTask("Building Index.... please be patient...may take a while", 100);
BuildIndex buildIndex = new BuildIndex();
buildIndex.copyArgs(args);
buildIndex.start();
boolean done = false; long indexStart = new Date().getTime();
int currentBarVal = 0;
double avgTimePerDoc = 0.0; double prevAvgTimePerDoc = 0.0;
while (!done)
{