Other Sandwich Situations - Groovin' with Groovy | [ Prev | Home | Next ] |
benchmark = { closure | start = System.currentTimeMillis() closure.call() now = System.currentTimeMillis() now - start } delta = benchmark { Thread.sleep(10000) } println "The command executed in ${delta} milliseconds"
Example 17
Copyright 2004 by Jim Weirich (Some Rights Reserved) |