• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Help with timer

 
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have two computers, laptop and a PC I noticed when using Timer class to create animations that it moves faster on my laptop than on my PC. I did a little test and found out that I was right. Below is the code I used for this test.




Basicly it adds the actual delay time into an array, then it prints out the average time.

I found that on my laptop the average time is 20 - 25 ms, but on my PC it is 40 - 45. Why is that?

I did another test using Thread:



This time the average time on both computers is around 20 ms, as it should be. Im in a dilemma should I change the code of my animation to use Thread instead of the Timer class, that would mean some extra work or try to figure out why the Timer class behaves like that.
[ September 15, 2005: Message edited by: Unnar Bj�rnsson ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic