Is there any timer like component in php?

Discussion in 'PHP' started by stronger, Jul 3, 2010.

  1. #1
    Is there any timer like component in php? I want to repeat particular event at particular time interval how can i do it using php?

    Please help me regarding this
     
    stronger, Jul 3, 2010 IP
  2. gapz101

    gapz101 Well-Known Member

    Messages:
    524
    Likes Received:
    8
    Best Answers:
    2
    Trophy Points:
    150
    #2
    setup a cron job
     
    gapz101, Jul 3, 2010 IP
  3. arunsinghrawat

    arunsinghrawat Greenhorn

    Messages:
    17
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #3
    you have to setup cron job for this.It repeat the particular script after a time interval defined by you
     
    arunsinghrawat, Jul 3, 2010 IP
  4. pig2cat

    pig2cat Active Member

    Messages:
    299
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    60
    #4
    you don't need to use cron for this, though it is probably better to do
    you can also just use a combination of
    set_time_limit(0); time() and date(), a while loop and sleep()
    I used this for a script of mine where I had to let the `game tick on` every half hour and wanted to use something different than cron
     
    pig2cat, Jul 4, 2010 IP