aboutsummaryrefslogtreecommitdiffstats
path: root/i.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2012-01-17 21:58:18 +0000
committerrvelices <rv-github@modusoptimus.com>2012-01-17 21:58:18 +0000
commitcc01941ed97f6c8f6790931bfc167ba45c5a8f91 (patch)
treefe465d457c034efba03cfe26d65b5467d88bfca2 /i.php
parente1bd64fdfc50f3ef50c0b4391c4586bbaeacb287 (diff)
feature 2548 multisize - code cleanup + better usage in category_cats + i.php logs memory usage peak
git-svn-id: http://piwigo.org/svn/trunk@12920 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'i.php')
-rw-r--r--i.php14
1 files changed, 4 insertions, 10 deletions
diff --git a/i.php b/i.php
index 1911d77ab..225c087a0 100644
--- a/i.php
+++ b/i.php
@@ -28,13 +28,6 @@ include(PHPWG_ROOT_PATH . 'include/config_default.inc.php');
defined('PWG_LOCAL_DIR') or define('PWG_LOCAL_DIR', 'local/');
defined('PWG_DERIVATIVE_DIR') or define('PWG_DERIVATIVE_DIR', $conf['data_location'].'i/');
-function get_moment()
-{
- $t1 = explode( ' ', microtime() );
- $t2 = explode( '.', $t1[0] );
- $t2 = $t1[1].'.'.$t2[1];
- return $t2;
-}
function trigger_action() {}
function get_extension( $filename )
{
@@ -127,7 +120,7 @@ function ierror($msg, $code)
function time_step( &$step )
{
$tmp = $step;
- $step = get_moment();
+ $step = microtime(true);
return intval(1000*($step - $tmp));
}
@@ -263,7 +256,7 @@ function send_derivative($expires)
$page=array();
-$begin = $step = get_moment();
+$begin = $step = microtime(true);
$timing=array();
foreach( explode(',','load,rotate,crop,scale,sharpen,watermark,save,send') as $k )
{
@@ -414,6 +407,7 @@ $timing['send'] = time_step($step);
ilog('perf',
basename($page['src_path']), $o_size, $o_size[0]*$o_size[1],
basename($page['derivative_path']), $d_size, $d_size[0]*$d_size[1],
+ function_exists('memory_get_peak_usage') ? round( memory_get_peak_usage()/(1024*1024), 1) : '',
time_step($begin),
- $timing);
+ '|', $timing);
?> \ No newline at end of file