// Try-resource
try (ScheduledExecutorService exec = Executors.newSingleThreadScheduledExecutor()){
exec.scheduleAtFixedRate(new Runnable() {
@Override
public void run() {
System.out.println("running");
}
}
, 0, 1, TimeUnit.SECONDS);
}
I have this ScheduledExecutorService, but I'm not sure how I can tell if it's working as I don't see anything printed in my terminal. I assume because it's running on another thread it's printing elsewhere?