Skip to content

Commit 14e64fe

Browse files
committed
Better timings
1 parent 3234e38 commit 14e64fe

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/main/java/sortVisualiser/SortArray.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,10 @@ public void paintComponent(Graphics g) {
121121
super.paintComponent(graphics);
122122

123123
graphics.setColor(Color.white);
124-
graphics.setFont(new Font("Monospaced", Font.BOLD, 25));
124+
graphics.setFont(new Font("Monospaced", Font.BOLD, 20));
125125
graphics.drawString(" Current algorithm: " + algorithmName, 10, 30);
126126
graphics.drawString("Current step delay: " + algorithmDelay + "ms", 10, 55);
127-
graphics.drawString("Array Changes : " + arrayChanges, 10, 80);
127+
graphics.drawString(" Array Changes: " + arrayChanges, 10, 80);
128128

129129
for (int x = 0; x < NUM_BARS; x++) {
130130
int height = getValue(x) * 2;

src/main/java/sortVisualiser/screens/SortingVisualiserScreen.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public SortingVisualiserScreen(ArrayList<ISortAlgorithm> algorithms, boolean pla
3232

3333
private void longSleep() {
3434
try {
35-
Thread.sleep(500);
35+
Thread.sleep(1000);
3636
} catch (InterruptedException ex) {
3737
ex.printStackTrace();
3838
}
@@ -50,7 +50,11 @@ public void onOpen() {
5050
SwingWorker swingWorker = new SwingWorker() {
5151
@Override
5252
protected Object doInBackground() throws Exception {
53-
System.out.println("RUNNING");
53+
try {
54+
Thread.sleep(250);
55+
} catch (InterruptedException ex) {
56+
ex.printStackTrace();
57+
}
5458
for (ISortAlgorithm algorithm : sortQueue) {
5559
shuffleAndWait();
5660

0 commit comments

Comments
 (0)