Thread: Delay?

    #1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2002
    Posts
    254
    Rep Power
    13

    Delay?


    Is there a delay method in java? Like I want to day the loop so it like does stuff every like second or something. Any help will be appreciated.
  2. #2
  3. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,648
    Rep Power
    4248
    The Thread object (java.lang.Thread) has a sleep method in it.

    Code:
    try {
        thrdFoo.sleep(250); // sleep for 1/4 sec
     } catch (InterruptedException e) {}

IMN logo majestic logo threadwatch logo seochat tools logo