Created
July 14, 2015 22:14
-
-
Save kylechase/2e1fe0fc61669c25654c to your computer and use it in GitHub Desktop.
websf isAccepting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public boolean isAccepting() { | |
Date now = new Date(); | |
if (sender != null && sender.isAvailable && (now.getTime() - lastSend.getTime()) > frequencyMS){ | |
log.infof("Sending data. Current Time - %s *** Last Send - %s *** Limit %s ms",now.toString(),lastSend.toString(),frequencyMS.toString()); | |
lastSend = (Date) now.clone(); | |
return true; | |
} else { | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment