Results 1 to 4 of 4
- 05-31-2011, 03:31 PM #1
Member
- Join Date
- May 2011
- Posts
- 7
- Rep Power
- 0
- 05-31-2011, 04:13 PM #2
Wouldn't util.Timer's fixed-delay execution cover that?
What exact effect are you going for?How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
- 05-31-2011, 05:49 PM #3
Member
- Join Date
- May 2011
- Posts
- 7
- Rep Power
- 0
Hi, thanks for your reply. I don't know the difference between fixedrate and delay. I can't find a good explanation of this on the internet.
I am developing a streaming application and the server (android device) needs to send a frame to the client every 100ms. But the server might not keep up. If sending it takes longer than 100ms, the next timerevent will have to wait for it to complete if I understand correctly. So the queue of timerevents will get really big. I need the event to look if the previous task has been completed, if not then skip.
I'll try fixedrate tommorrow. Thanks so far!
- 05-31-2011, 07:43 PM #4
This is just from the API for util.Timer: Timer (Java Platform SE 6)
In fixed-delay execution, each execution is scheduled relative to the actual execution time of the previous execution. If an execution is delayed for any reason (such as garbage collection or other background activity), subsequent executions will be delayed as well. In the long run, the frequency of execution will generally be slightly lower than the reciprocal of the specified period (assuming the system clock underlying Object.wait(long) is accurate).
In fixed-rate execution, each execution is scheduled relative to the scheduled execution time of the initial execution. If an execution is delayed for any reason (such as garbage collection or other background activity), two or more executions will occur in rapid succession to "catch up." In the long run, the frequency of execution will be exactly the reciprocal of the specified period (assuming the system clock underlying Object.wait(long) is accurate).How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
Similar Threads
-
java.util.NoSuchElementException
By Parkuss in forum New To JavaReplies: 1Last Post: 03-25-2011, 07:33 AM -
java.util.LinkedList;
By Andrew_2 in forum New To JavaReplies: 4Last Post: 03-25-2011, 04:40 AM -
java.util
By Java Tutorial in forum Java TutorialReplies: 1Last Post: 02-07-2008, 01:46 PM -
how to use java.util.Properties?
By christina in forum New To JavaReplies: 2Last Post: 08-03-2007, 05:26 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks