Modify time measuring to use System.nanoTime()

- Add binaries to make it easy to test.