Results 1 to 4 of 4
- 07-18-2012, 12:07 PM #1
Member
- Join Date
- Jul 2012
- Posts
- 2
- Rep Power
- 0
issue while using scheduleAtFixedRate()...
Hi,
I have written a code where in i need a counter to reset to zero after every 24 hrs. I have written below code but it is not working. although if i provide the value of period for 30 mins, it is working fine.
Please help:
private static Timer timer = new Timer();
private static int delay = 5000; // delay for 5 sec.
private static int period = 86400000; // repeat every day.
timer.scheduleAtFixedRate(new TimerTask() {
public void run() {
count =0;
log.info("Reseted value of count is ===========> "+count );
}
}, delay, period);
Thanks.
- 07-18-2012, 12:12 PM #2
Senior Member
- Join Date
- Apr 2010
- Location
- Belgrade, Serbia
- Posts
- 278
- Rep Power
- 4
Re: issue while using scheduleAtFixedRate()...
^I think this link could be helpful, particularly example 2:
Learner To Beginner: Java Timer Examples
Please, put you code inside [code] tags.
- 07-18-2012, 09:53 PM #3
Re: issue while using scheduleAtFixedRate()...
Forum Rules
Guide For New Members
BB Code List - Java Programming Forum
Not in any way an advanced question. Moving to New to Java.
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 07-24-2012, 06:31 AM #4
Member
- Join Date
- Jul 2012
- Posts
- 2
- Rep Power
- 0
Similar Threads
-
RMI issue
By yan1205 in forum NetworkingReplies: 0Last Post: 02-07-2012, 07:57 AM -
Regular Expression issue and setName() method issue
By geforce in forum New To JavaReplies: 2Last Post: 01-30-2012, 03:33 AM -
How do I fix this issue?
By m4mm4l in forum New To JavaReplies: 8Last Post: 11-17-2011, 03:49 AM -
nio issue
By mawandiadeepak in forum NetworkingReplies: 2Last Post: 03-17-2010, 05:23 AM -
PDF Box issue
By jazz2k8 in forum Advanced JavaReplies: 0Last Post: 03-20-2009, 11:04 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks