Closed aionick closed 5 years ago
The version of this defined by the JDK is found here: https://docs.oracle.com/javase/10/docs/api/java/util/concurrent/TimeUnit.html
I suspect that we want to implement this but exclude methods which reference ChronoUnit
or thread interactions. Specifically, this would mean removing of(ChronoUnit)
, sleep(long)
, timedJoin(Thread, long)
, timedWait(Object, long)
, and toChronoUnit()
. I suspect that the other JDK10 methods should be included.
The
TimeUnit
class provides contracts with a more descriptive way of talking about time, rather than arbitrarily hard-coding numbers, and duration is a not uncommon feature that smart contracts need to make use of in certain cases.The class has some unwanted functionality that needs to be removed for our scope, but in general is probably the most elegant means of talking about time that Java provides.