Advertisement
KuoHsiangYu

測試IDE效能2

Oct 3rd, 2018
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.49 KB | None | 0 0
  1. public class MainClass {
  2.  
  3.     public static void main(String[] args) {
  4.         long t1 = System.nanoTime();
  5.         for (int i = 0; i < 1000; i++) {
  6.             for (int j = 0; j < 1000; j++) {
  7.                 System.out.printf("O");
  8.                 System.out.printf("B");
  9.             }
  10.             System.out.printf("\n");
  11.         }
  12.         long t2 = System.nanoTime();
  13.         double seconds = (double) (t2 - t1) / 1000000000.0;
  14.         System.out.printf("%f seconds\n", seconds);
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement