Help with timer


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Help with timer

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Posts
    3

    Help with timer

    Hi everyone!
    I wrote an applet (its a part of a game) which creates an array contains 1475 elements. at the begginig the user sets a time (15 hours for example) and using the timer class, the array moves to the next element every 250 milliseconds.
    After 15 hours the applet returns the index of the array where it stopped.
    My problem is that I wanna have another button called "solve" that will give the index of the array where the applet will stop, before that 15 hours. Are there any methods that can help me? and if not, maybe some one can give me a logical explanation how can I do that?
    Thanks!

    Itay.

  2. #2
    Join Date
    Nov 2004
    Location
    Norway
    Posts
    1,560
    1475 elements, each "stopped at" every 250 ms, that tells me that the end is reached
    after appr. 6 minutes, so I guess your algorithm loops back to the start of the array
    then.
    Can't you just calculate how many ticks the 15 hrs represent and do that in a loop
    (without the time delay), it should finish right where your answer is.
    eschew obfuscation

Similar Threads

  1. Problem with Timer object
    By teja8100 in forum VB Classic
    Replies: 7
    Last Post: 05-18-2005, 09:44 AM
  2. timer in asp
    By jackal in forum ASP.NET
    Replies: 3
    Last Post: 03-28-2003, 01:29 PM
  3. Timer
    By Tomas in forum ASP.NET
    Replies: 0
    Last Post: 05-22-2002, 01:10 AM
  4. TIMER API
    By Ranger in forum VB Classic
    Replies: 2
    Last Post: 12-08-2000, 08:26 PM
  5. TIMER API
    By Ranger in forum VB Classic
    Replies: 0
    Last Post: 12-08-2000, 01:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center