import java.net.InetAddress; import java.net.UnknownHostException; public class NameLookUP_UserProvidedTC { public static void main(String[] args) { String version = System.getProperty("java.version"); System.out.println(version); Long start = System.currentTimeMillis(); for (int x=1;x<=100;x++) try { InetAddress.getLocalHost().getHostName(); Long currentElapsed = System.currentTimeMillis() - start; System.out.println("Iterration "+String.valueOf(x)+" current elapsed time "+String.valueOf(currentElapsed)); } catch (UnknownHostException e){ e.printStackTrace(); } Long finish = System.currentTimeMillis(); Long elapsed = finish - start; System.out.println("Total test elapsed time :"+elapsed.toString()); } }