Skip to content

Instantly share code, notes, and snippets.

@ohneda
Created May 13, 2014 23:12
Show Gist options
  • Save ohneda/5e002fc370f08f606df1 to your computer and use it in GitHub Desktop.
Save ohneda/5e002fc370f08f606df1 to your computer and use it in GitHub Desktop.
class GroovyBook {
String title
static main( args ){
Date now = new Date()
100000.times {
new GroovyBook( title: "title${it}")
}
println new Date().time - now.time
}
}
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