I have a
ThreadPoolExecutor cachedPool = (ThreadPoolExecutor)Executors.newCachedThreadPool();
The cachededPool
has to perform the following functionality in the main SimController
class.
Run method for a watcher thread. Once per Second, check and call a function.
public void run(){
if(m.isChanged()){
m.toString();
}
}
But it only executes the run method once. How can I make it run every second and create a watcher.