Trigger a run() method of Timer of Java manually -
so, set timer:
timer.scheduleatfixedrate(new timertask() { @override public void run() { ... } }, 5, 5); so want trigger run() testing something, not wait until gets triggered. there way?
just create runnable object before (not using anonymus class) , utilize create new thread , start it.
something
runnable runnable = new runnable() { @override public void run() { /*impl*/ } }; new thread(runnable).start(); java
No comments:
Post a Comment