PHP Classes

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
StarStarStar 56%Total: 1,649 This week: 1All time: 2,380 This week: 560Up
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: 34440 in United States United States
Week rank: 416 Down46 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,649
This week:1
All time:2,380
This week:560Up
User Ratings User Comments (1)
 All time
Utility:80%StarStarStarStarStar
Consistency:80%StarStarStarStarStar
Documentation:-
Examples:80%StarStarStarStarStar
Tests:-
Videos:-
Overall:56%StarStarStar
Rank:1853
 
ok, thats a very good class .
14 years ago (José Filipe Lopes Santos)
70%StarStarStarStar