diff --git a/target/src/main/java/com/miti99/Main.java b/target/src/main/java/com/miti99/Main.java
index 510d080..e5f9c1b 100644
--- a/target/src/main/java/com/miti99/Main.java
+++ b/target/src/main/java/com/miti99/Main.java
@@ -1,18 +1,15 @@
package com.miti99;
-// TIP To Run code, press or
-// click the icon in the gutter.
+import java.time.LocalDateTime;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+
public class Main {
- static void main() {
- // TIP Press with your caret at the highlighted text
- // to see how IntelliJ IDEA suggests fixing it.
- IO.println(String.format("Hello and welcome!"));
-
- for (int i = 1; i <= 5; i++) {
- // TIP Press to start debugging your code. We have set one breakpoint
- // for you, but you can always add more by pressing .
- IO.println("i = " + i);
- }
+ static void main() throws InterruptedException {
+ var executor = Executors.newSingleThreadScheduledExecutor();
+ executor.scheduleAtFixedRate(() -> IO.println(LocalDateTime.now()), 1, 1, TimeUnit.SECONDS);
+ Runtime.getRuntime().addShutdownHook(new Thread(executor::shutdown));
+ Thread.currentThread().join();
}
}