Java 8 Instant.now() with nanosecond resolution?

You can consider yourself lucky if you get even millisecond resolution.

Instant may model the time to nanosecond precision, but as for the actual resolution, it depends on the underlying OS implementation. On Windows, for example, the resolution is pretty low, on the order of 10 ms.

Compare this with System.nanoTime(), which gives resolution in the microseconds, but doesn’t give absolute wall-clock time. Clearly, there is already a tradeoff at work to give you that kind of resolution, still three orders of magnitude short of nanoseconds.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)