Closed FWDekker closed 4 years ago
@FWDekker thank you for submitting this -- seems legit, but I need to spend some time thinking it through just to make sure. Hoping to merge soon, then release new minor version due to API addition (3.3.0)
Do you have any updates on this? If there are any specific doubts or complaints you have I'd be happy to address those.
@FWDekker No doubts, just little bit busy life outside OSS work. This was on top of my todo list, so happy to merge now and hopefully get release out tonight (once I have access to my build system). Thank you for the improvement!
@cowtowncoder No worries! And thanks for the merge!
Thank you for the PR: 3.3.0 should be out now via Maven Central.
Fixes #20.
Adds a class called
UUIDClock
of which the only purpose is to return the current time usingSystem.currentTimeMillis()
. End users can create a subclass ofUUIDClock
to return whatever they want. TheUUIDClock
is given to theUUIDTimer
in its constructor, and the clock is used instead of directly callingSystem.currentTimeMillis
. I've added a separate constructor toUUIDTimer
for backwards compatibility; using the old constructor will cause theUUIDTimer
to use the default implementation ofUUIDClock
.I've added a single test which verifies that creating two different
UUIDTimer
s in the same way will result in the same result.