Skip to content

Commit 45e63eb

Browse files
committed
ejercicio15
1 parent 3c51713 commit 45e63eb

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Roadmap/15 - ASINCRONÍA/java/chartypes.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ private static Thread asynFunction(String funcitonName, int duration) {
1919
funcitonName + " started. Time: " + startTime +
2020
" milliseconds. Should take " + duration * 1000 + " milliseconds.");
2121
try {
22-
Thread.sleep((long) duration * 10000);
22+
Thread.sleep((long) duration * 1000);
2323
} catch (InterruptedException e) {
2424
System.out.println(e.getMessage());
2525
}
@@ -32,7 +32,7 @@ private static Thread asynFunction(String funcitonName, int duration) {
3232

3333
private static void exercise() {
3434
System.out.println("EXERCISE:");
35-
Thread thread = asynFunction("my function1", 1);
35+
Thread thread = asynFunction("my function1", 20);
3636
thread.start();
3737
try {
3838

@@ -58,9 +58,9 @@ private static void extra() {
5858
threadB.start();
5959
threadC.start();
6060

61-
threadA.join();
62-
threadB.join();
63-
threadC.join();
61+
threadA.join(5000);
62+
threadB.join(5000);
63+
threadC.join(5000);
6464

6565
System.out.println("Starting Function D...");
6666
threadD.start();

0 commit comments

Comments
 (0)