You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by tn...@apache.org on 2001/02/22 22:00:01 UTC
cvs commit: xml-xerces/c/samples/StdInParse StdInParse.cpp
tng 01/02/22 13:00:01
Modified: c/doc stdinparse.xml
c/samples/StdInParse StdInParse.cpp
Log:
[Bug 678] StdInParse doesn't output filename or duration
Revision Changes Path
1.5 +1 -1 xml-xerces/c/doc/stdinparse.xml
Index: stdinparse.xml
===================================================================
RCS file: /home/cvs/xml-xerces/c/doc/stdinparse.xml,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- stdinparse.xml 2000/06/20 02:28:53 1.4
+++ stdinparse.xml 2001/02/22 20:59:52 1.5
@@ -43,7 +43,7 @@
<p>Here is a sample output from StdInParse:</p>
<source>cd &XercesCInstallDir;-linux/samples/data
StdInParse < personal.xml
-personal.xml: 60 ms (37 elems, 12 attrs, 0 spaces, 268 chars)</source>
+stdin: 60 ms (37 elems, 12 attrs, 0 spaces, 268 chars)</source>
<note>The time reported by the program may be different depending on your
machine processor.</note>
1.7 +10 -2 xml-xerces/c/samples/StdInParse/StdInParse.cpp
Index: StdInParse.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/samples/StdInParse/StdInParse.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- StdInParse.cpp 2000/06/20 02:23:10 1.6
+++ StdInParse.cpp 2001/02/22 20:59:57 1.7
@@ -56,6 +56,9 @@
/*
* $Log: StdInParse.cpp,v $
+ * Revision 1.7 2001/02/22 20:59:57 tng
+ * [Bug 678] StdInParse doesn't output filename or duration
+ *
* Revision 1.6 2000/06/20 02:23:10 rahulj
* Help message added by Joe Polastre.
*
@@ -189,10 +192,14 @@
// Kick off the parse and catch any exceptions. Create a standard
// input input source and tell the parser to parse from that.
//
+ unsigned long duration;
+ StdInInputSource src;
try
{
- StdInInputSource src;
+ const unsigned long startMillis = XMLPlatformUtils::getCurrentMillis();
parser.parse(src);
+ const unsigned long endMillis = XMLPlatformUtils::getCurrentMillis();
+ duration = endMillis - startMillis;
}
catch (const XMLException& e)
@@ -204,7 +211,8 @@
}
// Print out the stats that we collected and time taken
- cout << handler.getElementCount() << " elems, "
+ cout << StrX(src.getSystemId()) << ": " << duration << " ms ("
+ << handler.getElementCount() << " elems, "
<< handler.getAttrCount() << " attrs, "
<< handler.getSpaceCount() << " spaces, "
<< handler.getCharacterCount() << " chars)" << endl;