There is a pretty cool concept of a Ticker in Guava. Unfortunately, it seems like it was designed around generating nano-second focused Stopwatches for measuring execution durations.
I'd like to find something to use like this because, it makes testing classes sensitive to time changes easier. I have run into an issue historically when I used System.currentTimeMillis()
because its hard to simulate the passage of time in a test. I was thinking of using a similar interface to what Guava has but measuring times in millis instead since that matches more of the available libraries.
I wanted to ask if anyone has seen something similar or has other suggestions before I go write it myself.