Set interval, how much time is this?

Discussion in 'JavaScript' started by Jen-, Oct 18, 2006.

  1. #1
    Hello, I am confused by my set enterval function in javascript. I looked on line with no luck helping explain this to me. For instance I have a set interval set for 30000 which ends up being a half a minute. Why is there so many 0's. Why isn't it just 30 for half a minute instead? Please explain. Is this a milisecond set interval? If so do I just increase it much more to reach an hour, or is there a set interval function for hours. Thanks!
     
    Jen-, Oct 18, 2006 IP
  2. BurgerKing

    BurgerKing Active Member

    Messages:
    397
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    58
    #2
    The setinterval time is measured in milliseconds.

    30,000 milliseconds = 30 seconds

    To make setinterval wait 1/2 an hour, use

    30 x 60 x 1,000 = 1,800,000 milliseconds
     
    BurgerKing, Oct 18, 2006 IP
  3. Jen-

    Jen- Peon

    Messages:
    151
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    It was milliseconds thank you. I am hoping this is my last javascript problem, they seem to all have happened in just the last few days. When I use set interval in my javascript, rotating items always starts over on page onload and I want them to keep going. That way if someone visits my page things rotate even from the middle of the javascript without starting over with items from the very beginning. What can I use in javascript to keep items from starting over from the very beginning on page onload. Thank you! Jen Here's my set interval function.

    setInterval("function_iframe()", 4000);
     
    Jen-, Oct 18, 2006 IP