Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,16 @@ public CompletableFuture<BigDecimal> getCurrentTimeAsync() {

/**
* Adds a property change listener for the {@code currentTime} property
*
* @param listener the property change listener
* @param period the minimum period between listener invocations, or 0 to disable throttling
* @param periodUnit time duration of throttling period
*
* @return current value in seconds
* @return this registration, for chaining
*/
public Registration addCurrentTimeChangeListener(
PropertyChangeListener listener, long time, TimeUnit timeUnit) {
int millis = (int) Math.min(timeUnit.toMillis(time), Integer.MAX_VALUE);
PropertyChangeListener listener, long period, TimeUnit periodUnit) {
int millis = (int) Math.min(periodUnit.toMillis(period), Integer.MAX_VALUE);
if (listener == null) {
listener = ev -> {};
}
Expand Down