forked from slgobinath/Java-Helps-Java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
33 lines (20 loc) · 707 Bytes
/
Main.java
File metadata and controls
33 lines (20 loc) · 707 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
public class Main {
public static void main(String[] args) {
// Get the start time
long startTime = System.currentTimeMillis();
Board chessBoard = new Board();
// Get the end time
long endTime = System.currentTimeMillis();
System.out.println("Time taken to create a board: " + (endTime - startTime) + " millis");
// Print the board
chessBoard.print();
System.out.println();
// Get the start time
startTime = System.currentTimeMillis();
Board checkersBoard = (Board) chessBoard.clone();
// Get the end time
endTime = System.currentTimeMillis();
System.out.println("Time taken to clone a board: " + (endTime - startTime) + " millis");
checkersBoard.print();
}
}