File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,9 +20,10 @@ public class dig {
2020}
2121
2222static void
23- doQuery (Message response ) throws IOException {
23+ doQuery (Message response , long ms ) throws IOException {
2424 System .out .println ("; java dig 0.0" );
2525 System .out .println (response );
26+ System .out .println (";; Query time: " + ms + " ms" );
2627}
2728
2829static void
@@ -61,6 +62,7 @@ public class dig {
6162 Record opt = null ;
6263 Resolver res = null ;
6364 boolean printQuery = false ;
65+ long startTime , endTime ;
6466
6567 if (argv .length < 1 ) {
6668 usage ();
@@ -181,12 +183,14 @@ public class dig {
181183 query .addRecord (opt , Section .ADDITIONAL );
182184 if (printQuery )
183185 System .out .println (query );
186+ startTime = System .currentTimeMillis ();
184187 response = res .send (query );
188+ endTime = System .currentTimeMillis ();
185189
186190 if (type == Type .AXFR )
187191 doAXFR (response );
188192 else
189- doQuery (response );
193+ doQuery (response , endTime - startTime );
190194}
191195
192196}
You can’t perform that action at this time.
0 commit comments