time = System.currentTimeMillis() - time;
time = System.currentTimeMillis() - time + 1;
    private static void profile(Grammar grammar, File file) {        Tokenizer  tokenizer;        Parser     parser;        Node       node;        long       time;        int        counter;                // Profile tokenizer        try {            tokenizer = grammar.createTokenizer(new FileReader(file));            System.out.println("Tokenizing " + file);            time = System.currentTimeMillis();            counter = 0;            while (tokenizer.next() != null) {                counter++;            }            time = System.currentTimeMillis() - time;            System.out.println("  Time elapsed:  " + time + " millisec");            System.out.println("  Tokens found:  " + counter);            System.out.println("  Average speed: " + (counter / time) +                               " tokens/millisec");            System.out.println();        } catch (FileNotFoundException e) {            printError(file.toString(), e);            System.exit(1);        } catch (GrammarException e) {            printInternalError(e);            System.exit(2);        } catch (ParseException e) {            printError(file.toString(), e);            System.exit(1);        }        // Profile parser        try {            tokenizer = grammar.createTokenizer(new FileReader(file));            parser = grammar.createParser(tokenizer);            System.out.println("Parsing " + file);            time = System.currentTimeMillis();            node = parser.parse();            time = System.currentTimeMillis() - time;            counter = 1 + node.getDescendantCount();            System.out.println("  Time elapsed:  " + time + " millisec");            System.out.println("  Nodes found:   " + counter);            System.out.println("  Average speed: " + (counter / time) +                               " nodes/millisec");            System.out.println();        } catch (FileNotFoundException e) {            printError(file.toString(), e);            System.exit(1);        } catch (GrammarException e) {            printInternalError(e);            System.exit(2);        } catch (ParserCreationException e) {            printInternalError(e);            System.exit(2);        } catch (ParserLogException e) {            printError(file.toString(), e);            System.exit(1);        }    }