PHP Classes

File: CLASSES/untitled.php

Recommend this page to a friend!
  Classes of Cuthbert Martin Lwinga   PHP Neural Net Library   CLASSES/untitled.php   Download  
File: CLASSES/untitled.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Neural Net Library
Build, train, evaluate, and use neural networks
Author: By
Last change:
Date: 1 month ago
Size: 713 bytes
 

Contents

Class file image Download
<?php
include_once("SharedMemoryHandler.php");
include_once(
"Threads.php");
use
NameSpaceThreads\Threads;

function
testbackground($param=1){
   
mt_srand(); // Seed the random number generator
   
$randomNumber = mt_rand(0, 4);
    echo
"\n $param will sleep for $randomNumber s\n";
   
sleep($randomNumber);
    echo
"\n $param woke up\n";
}

Threads::addTask("testbackground",[1]);
Threads::addTask("testbackground",[2]);
Threads::addTask("testbackground",[3]);
Threads::addTask("testbackground",[4]);
Threads::addTask("testbackground",[5]);
Threads::addTask("testbackground",[6]);
Threads::addTask("testbackground",[7]);
Threads::addTask("testbackground",[8]);
Threads::run(10);
echo
"\n\n all done \n\n";

?>