All Downloads are FREE. Search and download functionalities are using the official Maven repository.

src.demo.AutoWarmUpDemo.groovy Maven / Gradle / Ivy

There is a newer version: 0.4.3-groovy-2.4
Show newest version
/*
def bm = new groovyx.gbench.BenchmarkBuilder().run(verbose: true) {
    'StringBuilder' {
        def sb = new StringBuilder()
        sb.append('foo')
        sb.append('bar')
        sb.append('baz')
        sb.toString()
    }
    'StringBuffer' {
        def sb = new StringBuffer()
        sb.append('foo')
        sb.append('bar')
        sb.append('baz')
        sb.toString()
    }
}
bm.prettyPrint()
*/
benchmark(verbose:true) {
    'Each' {
        def i = 0
        (1..100000000).each { i ++ }
    }
    'For' {
        def i = 0
        for (x in 1..100000000) { i ++ }
    }
}.prettyPrint()





© 2015 - 2024 Weber Informatics LLC | Privacy Policy