Skip to content

Instantly share code, notes, and snippets.

@jastice
Last active December 18, 2015 21:49
Show Gist options
  • Save jastice/5849949 to your computer and use it in GitHub Desktop.
Save jastice/5849949 to your computer and use it in GitHub Desktop.
def sleepForTimes(ms: Long, times: Long) = {
var n = 0
() => {
n+=1
if (n <= times) {
Thread.sleep(ms)
true
} else {
false
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment