Revision 463
Added by berkley about 24 years ago
src/edu/ucsb/nceas/metacat/DocumentImpl.java | ||
---|---|---|
936 | 936 |
MetaCatUtil util = new MetaCatUtil(); |
937 | 937 |
Connection dbconn = util.openDBConnection(); |
938 | 938 |
|
939 |
double connTime = System.currentTimeMillis(); |
|
939 | 940 |
// Execute the action requested (READ, INSERT, UPDATE, DELETE) |
940 | 941 |
if (action.equals("READ")) { |
941 | 942 |
DocumentImpl xmldoc = new DocumentImpl( dbconn, docid ); |
... | ... | |
964 | 965 |
} |
965 | 966 |
|
966 | 967 |
double stopTime = System.currentTimeMillis(); |
968 |
double dbOpenTime = (connTime - startTime)/1000; |
|
969 |
double insertTime = (stopTime - connTime)/1000; |
|
967 | 970 |
double executionTime = (stopTime - startTime)/1000; |
968 | 971 |
if (showRuntime) { |
969 |
System.out.println("\n\nExecution time was: " + |
|
970 |
executionTime + " seconds"); |
|
972 |
System.out.println("\n\nTotal Execution time was: " + |
|
973 |
executionTime + " seconds."); |
|
974 |
System.out.println("Time to open DB connection was: " + dbOpenTime + |
|
975 |
" seconds."); |
|
976 |
System.out.println("Time to insert document was: " + insertTime + |
|
977 |
" seconds."); |
|
971 | 978 |
} |
979 |
dbconn.close(); |
|
972 | 980 |
} catch (McdbException me) { |
973 | 981 |
me.toXml(new PrintWriter(System.err)); |
974 | 982 |
} catch (AccessionNumberException ane) { |
Also available in: Unified diff
added extra timing information to the main() driver method.