Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

time debug php

// Script start
$rustart = getrusage();

// Code ...

// Script end
function rutime($ru, $rus, $index) {
    return ($ru["ru_$index.tv_sec"]*1000 + intval($ru["ru_$index.tv_usec"]/1000))
     -  ($rus["ru_$index.tv_sec"]*1000 + intval($rus["ru_$index.tv_usec"]/1000));
}

$ru = getrusage();
echo "This process used " . rutime($ru, $rustart, "utime") .
    " ms for its computations
";
echo "It spent " . rutime($ru, $rustart, "stime") .
    " ms in system calls
";
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #time #debug #php
ADD COMMENT
Topic
Name
9+9 =