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

Recommend this page to a friend!
  Info   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum (3)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 61%Total: 1,628 All time: 2,392 This week: 258Up
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 Shull
Name: Sam Shull <contact>
Classes: 9 packages by
Country: United States United States
Age: 44
All time rank: 34539 in United States United States
Week rank: 691 Down68 in United States United States Down
Innovation award
Innovation award
Nominee: 8x

  Files folder image Files  
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

 Version Control Unique User Downloads Download Rankings  
 0%
Total:1,628
This week:0
All time:2,392
This week:258Up
User Ratings User Comments (1)
 All time
Utility:87%StarStarStarStarStar
Consistency:87%StarStarStarStarStar
Documentation:-
Examples:87%StarStarStarStarStar
Tests:-
Videos:-
Overall:61%StarStarStarStar
Rank:1244
 
ok, thats a very good class .
11 years ago (Josť Filipe Lopes Santos)
70%StarStarStarStar
 

For more information send a message to info at phpclasses dot org.