1

Some Php Process took long time to complete, like several hours.

So users cannot wait for loading the php file. Please help to find the way how i could run php in background. It should be processing in the background(could be hosting background or something else) although after we closed that php.

Ander2
  • 5,569
  • 2
  • 23
  • 42

1 Answers1

-2

Have you ever tried microtime()..?
Timing How Long Code Takes to Execute

This little technique is really useful if you want to time exactly long it too to, say, load a page, or run a block of code. It takes advantage of PHP's microtime() function.

$start = microtime(true);
//Do stuff in here
sleep(1);
//Stop doing stuff
$end = microtime(true);
$time = $end - $start;
echo $time;
Mohan Raj
  • 447
  • 1
  • 5
  • 18