PHP Classes

setTimeout and setInterval: Call a function after a period of time

Recommend this page to a friend!
     
  Info   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 56%Total: 1,649 All time: 2,380 This week: 660Up
Version License PHP version Categories
callback_timers 0.5MIT/X Consortium ...5.0PHP 5, Time and Date, Language
Description 

Author

This class can be used to make PHP call a function after a period of time.

It can register one or more callback functions that should be called after a given timeout value or every time after a given period of time elapses.

The class registers a single callback function to handle PHP tick calls. That function takes care of calling all registered timer callback functions.

Innovation Award
PHP Programming Innovation award nominee
August 2009
Number 7


Prize: One downloadable e-book of choice by O'Reilly
Some applications have scripts that need to execute tasks that take a long time to execute.

In some cases, it is convenient to execute code periodically during the execution of such long tasks, like for instance to update information about the tasks' progress.

This class provides a generic solution for regularly calling application defined code during the execution of a long task.

Manuel Lemos
Picture of Sam S
Name: Sam S <contact>
Classes: 9 packages by
Country: United States United States
Age: 49
All time rank: 34540 in United States United States
Week rank: 216 Up24 in United States United States Up
Innovation award
Innovation award
Nominee: 8x

  Files folder image Files (4)  
File Role Description
Accessible without login Plain text file Timers.class.php Class The class and function definition file
Accessible without login Plain text file Timers_test.php Example An example of how the timers are implemented and used.
Accessible without login Plain text file Timers_test2.php Example An additional portion of the example
Accessible without login Plain text file Timers_test3.php Example An additional portion of the example

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:1,649
This week:0
All time:2,380
This week:660Up
User Ratings User Comments (1)
 All time
Utility:80%StarStarStarStarStar
Consistency:80%StarStarStarStarStar
Documentation:-
Examples:80%StarStarStarStarStar
Tests:-
Videos:-
Overall:56%StarStarStar
Rank:1880
 
ok, thats a very good class .
15 years ago (José Filipe Lopes Santos)
70%StarStarStarStar