Use System.nanoTime() for timeout calculation

This fixes #150.