Created
May 13, 2014 23:12
-
-
Save ohneda/5e002fc370f08f606df1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GroovyBook { | |
String title | |
static main( args ){ | |
Date now = new Date() | |
100000.times { | |
new GroovyBook( title: "title${it}") | |
} | |
println new Date().time - now.time | |
} | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Date; | |
public class JavaBook { | |
String title; | |
public Book( String title ){ | |
this.title = title; | |
} | |
public static void main(String[] args){ | |
Date now = new Date(); | |
for( int i = 0; i< 100000; i++){ | |
new JavaBook( "title" + i ); | |
} | |
System.out.println( ( new Date().getTime() - now.getTime() ) + "sec." ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment