Ejemplo n.º 1
0
        }
    } else {
        //        $city_address_attributes->add( $new_rec );
        print "\nEEEE\n";
        $totals['city_address_attributes']['insert']++;
    }
}
print "\nTotals\n--------------------------------------------------------------------------\n";
printf("%-30.30s %10s %10s %10s %10s\n", 'table', 'insert', 'update', 'N/A', 'ERROR');
foreach ($totals as $table => $counts) {
    printf("%-30.30s %10d %10d %10d %10d\n", $table, $counts['insert'], $counts['update'], $counts['N/A'], $counts['error']);
}
print "--------------------------------------------------------------------------\n\n";
print "Number of lines processed {$row}\n\n";
// Calcuate how much time this took
$end_time = time();
$time_diff = $end_time - $start_time;
if ($time_diff > 0) {
    $time_diff = time_elapsed_A($time_diff);
} else {
    $time_diff = ' 0 seconds';
}
$ru = getrusage();
$str = "This process used " . rutime($ru, $rustart, "utime") . " ms for its computations\n";
print "\n";
print $str;
$str = "It spent " . rutime($ru, $rustart, "stime") . " ms in system calls\n";
print $str;
// Print end message with time it took
print "Run time:  {$time_diff}\n";
print "\n\n";
Ejemplo n.º 2
0
//$text = array();
//$text[] = "カリン、自分でまいた種は自分で刈り取[qw]";
//$text[] = 'モーラ、モラ(mora)とは、音韻論上、一定の時間的長さをもった音の分節単位。古典詩における韻律用語であるラテン語のmŏra(モラ)の転用(日本語における「モーラ」という表記は英語からの音訳であり、「モラ」という表記はラテン語からの音訳)。拍(はく)と訳される。';
$type = 0;
if ($_POST["dict"]) {
    $type |= Processor::Lemmas;
}
if ($_POST["rubies"]) {
    $type |= Processor::Rubies;
}
if ($_POST["full_reading"]) {
    $type |= Processor::FullReadings;
}
//$type = Processor::ReadingsAndLemmas;
$proc = new Processor($type);
$retv = array();
$sent = 0;
foreach ($text as $v) {
    $proc->send_text($v);
    $sent++;
    if ($sent >= 3) {
        $retv[] = $proc->get_response();
        $sent--;
    }
}
while ($sent) {
    $retv[] = $proc->get_response();
    $sent--;
}
jexit(array("status" => "OK", "wall_time" => microtime(true) - $time_start, "cpu_time" => rutime(getrusage(), $ru_start, "utime"), "data" => $retv));
                $DrivingRoute .= '(' . $points->Latitude . ', ' . $points->Longitude . ')';
                $TimeStamps .= $points->TimeStamp;
            } else {
                $DrivingRoute .= '(' . $points->Latitude . ', ' . $points->Longitude . '),';
                $TimeStamps .= $points->TimeStamp . ", ";
            }
            $x++;
        }
        $sql = "INSERT INTO GPSTruckRoute (GPSID, CustomerID, Date, Route, TimeStamp) VALUES (:id, :customerid, :date, :route, :timestamps)";
        $params = array(':id' => $GPSID, ':customerid' => $CustomerID, ':date' => $date, ':route' => $DrivingRoute, ':timestamps' => $TimeStamps);
        $stm3 = pdo_execute_non_query($sql, $params);
        if ($stm3) {
            echo "Success<br />";
        } else {
            echo "Failure<br />";
        }
    }
}
$time_end = microtime(true);
$execution_time = ($time_end - $time_start) / 60;
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();
$MessageTime = "[SYSTEM-MSG] Save Truck Route - Total Execution Time:" . $execution_time . " minutes";
$MessageTime2 = "[SYSTEM-MSG] Save Truck Route - This process used: " . rutime($ru, $rustart, "utime") . " ms for its computations";
$MessageTime3 = "[SYSTEM-MSG] Save Truck Route - It spent: " . rutime($ru, $rustart, "stime") . " ms in system calls";
ps_log_root($MessageTime);
ps_log_root($MessageTime2);
ps_log_root($MessageTime3);
Ejemplo n.º 4
0
        }
    }
    print "</tr>";
}
print '</table>';
echo 'Dimensions: ' . $bl->dim[0] . ', ' . $bl->dim[1] . " px<br>\n";
//echo 'Step: ' . $bl->step . " px<br>\n";
echo 'Selection: ' . (1 + $area[2] - $area[0]) . ',' . (1 + $area[3] - $area[1]) . "<br>\n";
// 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<br>\n";
echo "It spent " . rutime($ru, $rustart, "stime") . " ms in system calls<br>\n";
echo "Peak memory allocated " . memory_get_peak_usage(true) / 1024 / 1024 . " MB<br>\n";
$im = imagecreatefromjpeg($fname);
$pink = imagecolorallocatealpha($im, 255, 105, 180, 50);
imagefilledrectangle($im, $area[0], $area[1], $area[2], $area[3], $pink);
//$out = dirname(__FILE__) . '/test/out.jpg';
//imagepng($im, $out);
//imagedestroy($im);
echo '<canvas id="canvas" width="' . $bl->dim[0] . '" height="' . $bl->dim[1] . '"></canvas>';
?>

<script type="text/javascript">

  function draw () {

    var canvas = document.getElementById('canvas'),
Ejemplo n.º 5
0
<?php

$start = microtime();
$rustart = getrusage();
require_once 'includes/settings.php';
require_once 'includes/load.php';
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 -->\n";
echo "<!-- It spent " . rutime($ru, $rustart, "stime") . " ms in system calls -->\n";
echo "<!-- execution time: " . (microtime() - $start) . " -->";