java - Executor service to run every x seconds -


What is the correct way to get an executable service to submit seconds of every x number?

  Public Zero Start () {executorService.submit (new Runnabal) (Public Zero Run) {Scheduled Future & lt; Integer> Results = Executable Service Searchules (Value, X, Time) Unit SECONDS);}); }   

Wrap the content of the method of running in some time (Thread.currentThread (.) Integrated ()) should be a valid approach - if not, how should it be done?

Thanks

Use:

  Scheduled ExeterService ses = Executors.newScheduledThreadPool (10); Ses.scheduleAtFixedRate (New Runnabal) {@Override Public Zero () {// some work}}, 0, X, time unit SECONDS); // execute every x seconds    

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -