2021-08-05
This commit is contained in:
20
thread/logback.xml
Normal file
20
thread/logback.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~ Examples for Java
|
||||
~
|
||||
~ Copyright (c) 2021. Elex. All Rights Reserved.
|
||||
~ https://www.elex-project.com/
|
||||
-->
|
||||
|
||||
<configuration>
|
||||
|
||||
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<root level="TRACE">
|
||||
<appender-ref ref="CONSOLE" />
|
||||
</root>
|
||||
</configuration>
|
||||
@@ -13,6 +13,7 @@ import java.time.Duration;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.Period;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.time.temporal.TemporalUnit;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
@@ -27,11 +28,11 @@ public class Sample {
|
||||
executor.scheduleAtFixedRate(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
System.out.println("Hi~");
|
||||
}
|
||||
},
|
||||
Duration.between(LocalDateTime.now(), startTime).abs().get(ChronoUnit.MILLIS),
|
||||
Period.ofDays(1).get(ChronoUnit.MILLIS),
|
||||
Duration.between(LocalDateTime.now(), startTime).abs().toMillis(),
|
||||
Duration.ofDays(1).toMillis(),
|
||||
TimeUnit.MILLISECONDS);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user