-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTeste001.java
More file actions
57 lines (31 loc) · 930 Bytes
/
Copy pathTeste001.java
File metadata and controls
57 lines (31 loc) · 930 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package Programa;
import java.util.Arrays;
public class Teste001 {
public static void main(String[] args) {
long startTime = System.nanoTime();
int lista[] = {5, 3, 2, 8, 1, 7, 4, 11, 12, 14};
System.out.println(Arrays.toString(lista));
System.out.println("--------------------------");
System.out.println("tamanho lista: " + lista.length);
System.out.println("--------------------------");
int v1 = 3;
int v2 = v1;
v1 = 5;
System.out.println("v1: " + v1);
System.out.println("v2: " + v2);
// Your code here
long endTime = System.nanoTime();
long duration = (endTime - startTime); // total time in nanoseconds
//milliseconds
System.out.println("Execution time: " + (duration / 1000000) + " ms");
}
}
/*
[5, 3, 2, 8, 1, 7, 4, 11, 12, 14]
--------------------------
tamanho lista: 10
--------------------------
v1: 5
v2: 3
Execution time: 14 ms
*/