fork(7) download
  1. class Main {
  2. public static void main(String args[]) {
  3. long bigDTime, littleDTime;
  4.  
  5. {
  6. long start = System.nanoTime();
  7. Double d = 0.0;
  8. for (Double i = 0.0; i < 1432143.341; i += 0.1) {
  9. d += i;
  10. }
  11. long end = System.nanoTime();
  12. bigDTime = end - start;
  13. System.out.println(bigDTime);
  14. }
  15.  
  16. {
  17. long start = System.nanoTime();
  18. double d = 0.0;
  19. for (double i = 0.0; i < 1432143.341; i += 0.1) {
  20. d += i;
  21. }
  22. long end = System.nanoTime();
  23. littleDTime = end - start;
  24. System.out.println(littleDTime);
  25. }
  26.  
  27. System.out.println("D/d = " + (bigDTime / littleDTime));
  28. }
  29. }
Success #stdin #stdout 0.4s 380224KB
stdin
Standard input is empty
stdout
294873619
37749162
D/d = 7