PHP Classes

File: examples/longRunningFunction.php

Recommend this page to a friend!
  Classes of Camilo Sperberg  >  PID process check  >  examples/longRunningFunction.php  >  Download  
File: examples/longRunningFunction.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PID process check
Check if a PHP script is running using PID files
Author: By
Last change: Update of examples/longRunningFunction.php
Date: 5 months ago
Size: 430 bytes


Class file image Download

 * This function will pause the execution of the script, simulating a long running process
function longRunningFunction($timeout=1, $pid) {
    for (
$i = 1; $i != $timeout; $i++) {
'PID %d: %d/%d. Execute this script again within the time limit to test PID presence.'.PHP_EOL,


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