mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
No effective change - Add simple profile query main
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
package org.tests.profile;
|
||||
|
||||
import org.tests.model.basic.Customer;
|
||||
//import org.tests.model.basic.ResetBasicData;
|
||||
|
||||
public class ProfileSimpleQuery {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
// ResetBasicData.reset();
|
||||
ProfileSimpleQuery me = new ProfileSimpleQuery();
|
||||
me.runIt();
|
||||
|
||||
}
|
||||
|
||||
private long counter;
|
||||
|
||||
private void runIt() {
|
||||
long start = System.currentTimeMillis();
|
||||
for (int i = 0; i < 1000_000; i++) {
|
||||
readCustomer();
|
||||
}
|
||||
long exe = System.currentTimeMillis() - start;
|
||||
System.out.println("run in " + exe);
|
||||
}
|
||||
|
||||
private void readCustomer() {
|
||||
Customer customer = Customer.find.byName("Rob");
|
||||
String name = customer.getName();
|
||||
if (name.length() > 999) {
|
||||
counter++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user