diff --git a/AlgebraicDataflowArchitectureModel/src/experiment/PullExpriment.java b/AlgebraicDataflowArchitectureModel/src/experiment/PullExpriment.java index 7e30be5..85edb93 100644 --- a/AlgebraicDataflowArchitectureModel/src/experiment/PullExpriment.java +++ b/AlgebraicDataflowArchitectureModel/src/experiment/PullExpriment.java @@ -6,47 +6,48 @@ public static void main(String[] args) { Main main = new Main(); Long times = (long) 0; - int num = 100000; + int num = 10000; + int kirisute = 100; for (int i = 0; i < num; i++) { long startTime = System.nanoTime(); main.purchase(100); long endTime = System.nanoTime(); main.getHistory().clear(); - times += endTime - startTime; + if(i > kirisute) times += endTime - startTime; } - System.out.println("purchase:" + (double) times / num); + System.out.println("purchase:" + (double) times / (num - kirisute)); times = (long) 0; for (int i = 0; i < num; i++) { long startTime = System.nanoTime(); main.getHistory(); long endTime = System.nanoTime(); - times += endTime - startTime; + if(i > kirisute) times += endTime - startTime; } - System.out.println("getHistory:" + (double) times / num); + System.out.println("getHistory:" + (double) times / (num - kirisute)); times = (long) 0; for (int i = 0; i < num; i++) { long startTime = System.nanoTime(); main.getPayment(); long endTime = System.nanoTime(); - times += endTime - startTime; + if(i > kirisute) times += endTime - startTime; } - System.out.println("getPayment:" + (double) times / num); + System.out.println("getPayment:" + (double) times / (num - kirisute)); times = (long) 0; for (int i = 0; i < num; i++) { long startTime = System.nanoTime(); main.getPoints(); long endTime = System.nanoTime(); - times += endTime - startTime; + if(i > kirisute) times += endTime - startTime; } - System.out.println("getPoints:" + (double) times / num); + System.out.println("getPoints:" + (double) times / (num - kirisute)); times = (long) 0; for (int i = 0; i < num; i++) { long startTime = System.nanoTime(); main.getTotal(); long endTime = System.nanoTime(); - times += endTime - startTime; + if(i > kirisute) times += endTime - startTime; } - System.out.println("getTotal:" + (double) times / num); + System.out.println("getTotal:" + (double) times / (num - kirisute)); } }