forked from AndreasPrang/Programming-Languages-Speed-Test
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest.java
More file actions
Latest commit
29 lines (22 loc) · 584 Bytes
/
Copy pathTest.java
File metadata and controls
29 lines (22 loc) · 584 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
classTest
{
publicstaticvoidmain(String [] args)
{
// String[] methodsToTest = new String []
// methodsToTest.add("forEachLoopMaxInteger");
longstartTime = System.currentTimeMillis();
longtotal = 0;
forEachLoopMaxInteger(100000000);
longstopTime = System.currentTimeMillis();
longelapsedTime = stopTime - startTime;
System.out.println("Java: " + elapsedTime + "ms");
}
publicstaticintforEachLoopMaxInteger(Integermax) {
longsum = 0;
for (Integern = max; n > 0; n--) {
doublefoo = n / 17;
sum = sum + n ;
}
returnmax;
}
}