-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
28 lines (20 loc) · 683 Bytes
/
Main.java
File metadata and controls
28 lines (20 loc) · 683 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
import ChessBoard.ChessBoard;
import ChessBoard.Board;
import ChessPiece.*;
import ChessPiece.ChessPiece;
import ChessPiece.PieceColor;
import java.awt.*;
public class Main {
public static void main(String[] args) {
double start, end;
start = System.nanoTime();
for (int i = 0; i < 1_000_000_000; i++) {
ChessPiece piece = new Pawn(PieceColor.WHITE);
}
ChessPiece piece = new Pawn(PieceColor.WHITE);
end = System.nanoTime();
ChessBoard board = new Board();
board.addPiece(piece, new Point(0, 0));
System.out.println("Time to create a Pawn: " + (end - start) / 1_000_000 + "ms");
}
}