Skip to content

Instantly share code, notes, and snippets.

@bytekast
Last active March 26, 2017 05:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bytekast/d1265fa012009c153184923b1067d9a7 to your computer and use it in GitHub Desktop.
Save bytekast/d1265fa012009c153184923b1067d9a7 to your computer and use it in GitHub Desktop.
@Grab(group='org.codehaus.gpars', module='gpars', version='1.2.1')
import static groovyx.gpars.GParsPool.withPool
withPool(100) {
(1..2000).eachParallel { i ->
def beginTime = System.currentTimeMillis()
def result = 'https://xxxxx.execute-api.us-east-1.amazonaws.com/dev/users'.toURL().text
println "${i}: ${System.currentTimeMillis() - beginTime}"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment