• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Timed events

 
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Im using timer to make objects move on the screen.

TimeListener is the actionlistener.
I found that 20 is good delaytime but when I run the application on my laptop everything moves faster as if the delay was set to 10.
How do I make the timer consistent between all computers?
 
Ranch Hand
Posts: 410
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The time should be the same across machines. Then again, 20 milliseconds is such a short time that it is hard to measure - how are you determining that the delay varies? Try a larger time interval (say 2000 milliseconds) and see what happens.
 
Unnar Björnsson
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Stuart Gray:
The time should be the same across machines. Then again, 20 milliseconds is such a short time that it is hard to measure - how are you determining that the delay varies? Try a larger time interval (say 2000 milliseconds) and see what happens.



But that would make it 2 seconds an animation with 2 second delay time between frames is very slow. I make the icon on screen update it�s Y-coordinates every 20 ms, 2 seconds is way too much.
 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Unnar Bj�rnsson:


But that would make it 2 seconds an animation with 2 second delay time between frames is very slow. I make the icon on screen update it�s Y-coordinates every 20 ms, 2 seconds is way too much.



Just a guess, but maybe you are changing the Y-coordinate by a fixed number of pixels, and the screen resolution on your laptop is lower than on your other computer. If this is the case, then the icon would appear to move faster on the laptop, even though it is updating the same number of times per second.
 
Unnar Björnsson
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ed Ewing:


Just a guess, but maybe you are changing the Y-coordinate by a fixed number of pixels, and the screen resolution on your laptop is lower than on your other computer. If this is the case, then the icon would appear to move faster on the laptop, even though it is updating the same number of times per second.



Nope same resolution, and refresh rate.
 
reply
    Bookmark Topic Watch Topic
  • New Topic