java.lang.System.nanoTime() is used to measure time spans as precisely as possible (if you actually get nanosecond precision depends on the platform). I just found a funny warning in the documentation:
Differences in successive calls that span greater than approximately 292 years (263 nanoseconds) will not accurately compute elapsed time due to numerical overflow.
I didn’t really think about running my Java programs for such a long time, but thanks!
The Android API documentation omits this warning. I don’t think that’s a real problem, but I found it to be imprecise in other cases, too. For example, the hint that the prefix string for
java.io.File.createTempFile(String prefix, String suffix) must be at least three characters long is missing. That was easy enough to fix, but it would save some time to know stuff like this without running into an exception. Android has some funny methods of its own, though.