From cc01941ed97f6c8f6790931bfc167ba45c5a8f91 Mon Sep 17 00:00:00 2001 From: rvelices Date: Tue, 17 Jan 2012 21:58:18 +0000 Subject: 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 --- i.php | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'i.php') 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 -- cgit v1.2.3