Skip to content

Instantly share code, notes, and snippets.

@kylechase
Created July 14, 2015 22:14
Show Gist options
  • Save kylechase/2e1fe0fc61669c25654c to your computer and use it in GitHub Desktop.
Save kylechase/2e1fe0fc61669c25654c to your computer and use it in GitHub Desktop.
websf isAccepting
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