With the following code:
try {
System.out.println(new Date());
InetAddress hostName = InetAddress.getLocalHost();
System.out.println(new Date());
} catch (UnknownHostException e) {
e.printStackTrace();
}
I get this output:
Thu Oct 22 20:58:22 BST 2015
Thu Oct 22 20:58:52 BST 2015
In other words 30 seconds to execute. Machine is 2015 Macbook Pro with Java 1.8.0_60.
Why does this take so long?