Menu

About timer

Help
2003-01-09
2003-01-13
  • Nobody/Anonymous

    There is registerTimehandler function and as I know it will call indicated method every n-seconds. But what I must do if I want that method will called only once in n-seconds?

     
    • Mirco Bauer

      Mirco Bauer - 2003-01-09

      that is pretty easy, just a logical thing...

      register the timerhandler for your method that you want to be called once, then call _in_ your registered method the unregisterTimerid(), that will avoid that the method will be called again... so its only once called, like you want... for more info about how to unregister a timer see this post:
      http://sourceforge.net/forum/forum.php?thread_id=791813&forum_id=204500

       
    • Nobody/Anonymous

      if i use several timers (if it's possible) how to know their id?

       
    • Mirco Bauer

      Mirco Bauer - 2003-01-13

      of you can use several timers, the return value of the registerTimerhandler() method is the assigned id, like its documentated...

      $id1 = $irc->registerActionhandler(...);
      $id2 = $irc->registerActionhandler(...);
      $id3 = $irc->registerActionhandler(...);
      $irc->unregisterActionid($id1);
      $irc->unregisterActionid($id2);
      $irc->unregisterActionid($id3);

       
    • Mirco Bauer

      Mirco Bauer - 2003-01-13

      eeerrr, I meant "Time" not "Action"
      but both work exactly the same ;)

       

Log in to post a comment.