001// TimerDemo.java: demonstration application showing time elapsed for parse. 002// NO WARRANTY! See README, and copyright below. 003// $Id$ 004// Modified 11/8/98 to add package statement. 005package com.microstar.xml.demo; 006 007/** 008 * Demonstration application showing time elapsed for parse. 009 * <p>Usage: <code>java TimerDemo <url></code> 010 * <p>Or, use it as an applet, supplying the URL as the <code>url</code> 011 * parameter. 012 * @author Copyright (c) 1997, 1998 by Microstar Software Ltd.; 013 * @author written by David Megginson <dmeggins@microstar.com> 014 * @version 1.1 015 * @since Ptolemy II 0.2 016 * @see com.microstar.xml.XmlParser 017 * @see com.microstar.xml.XmlHandler 018 * @see XmlApp 019 */ 020public class TimerDemo extends XmlApp { 021 /** 022 * Entry point for an application. 023 * @param args The arguments. The first argument should be the uri 024 * @exception Exception If the parse fails 025 */ 026 public static void main(String[] args) throws java.lang.Exception { 027 long start; 028 long end; 029 TimerDemo demo = new TimerDemo(); 030 031 if (args.length != 1) { 032 System.err.println("Usage: java TimerDemo <uri>"); 033 System.exit(1); 034 } 035 036 System.out.println("Starting parse..."); 037 start = System.currentTimeMillis(); 038 demo.doParse(args[0]); 039 end = System.currentTimeMillis(); 040 System.out.println("Elapsed time: " + (end - start) + " ms"); 041 } 042} 043 044// End of TimerDemo.java