コード例 #1
0
ファイル: process_helper.php プロジェクト: cgarciagl/Yupii
function processStart()
{
    $ci =& get_instance();
    set_time_limit(0);
    ini_set('memory_limit', '-1');
    @ini_set('zlib.output_compression', 0);
    @ini_set('implicit_flush', 1);
    @ob_end_clean();
    @($ci->db->save_queries = FALSE);
    ob_implicit_flush(TRUE);
    timeStart();
    fecho($ci->load->view('process/progress', NULL, TRUE));
}
コード例 #2
0
ファイル: stopwatch.php プロジェクト: riichard/phpstopwatch
<?php

/* This is a tool to measure how long the execution time is of a piece of code.
It works like this:*/
/* Put this in a script you always include in your code */
$times = array();
$timesStopped = array();
function timeStart($name)
{
    $time = explode(" ", microtime());
    $time = $time[1] + $time[0];
    global $times;
    $times[$name] = $time;
    return $time;
}
function timeStop($name)
{
    $time = explode(" ", microtime());
    $time = $time[1] + $time[0];
    global $times, $timesStopped;
    $timesStopped[$name] = round($time - $times[$name], 4);
    return $timesStopped[$name];
}
/* Do this with your code */
timeStart("getting post from database");
mysql_query("SELECT title, text, author FROM posts WHERE id=" . mysql_real_escape_string($_GET['post_id']));
timeStop("getting post from database");
/* Put this on the end of your code, the executed times will be displayed in seconds */
print_r($timesStopped);