Skip to content

Instantly share code, notes, and snippets.

@jeremywen
Last active May 10, 2016 15:35
Show Gist options
  • Save jeremywen/72f160a237269c1688c29b35261828e9 to your computer and use it in GitHub Desktop.
Save jeremywen/72f160a237269c1688c29b35261828e9 to your computer and use it in GitHub Desktop.
groovysh.profile
//Put this file in $HOME/.groovy/groovysh.profile
//Example Output:
// groovy:000> time{(1..1000).collect{it}.unique();}
// took 59 millis
time = { Closure c ->
def start = new Date()
c()
println "took ${new Date().time-start.time} millis"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment