[pLog-svn] r4423 - plog/branches/lifetype-1.1.4/class/misc
jondaley at devel.lifetype.net
jondaley at devel.lifetype.net
Sat Dec 23 21:48:11 GMT 2006
Author: jondaley
Date: 2006-12-23 21:48:10 +0000 (Sat, 23 Dec 2006)
New Revision: 4423
Modified:
plog/branches/lifetype-1.1.4/class/misc/info.class.php
Log:
use get_peak_usage for php5 users
Modified: plog/branches/lifetype-1.1.4/class/misc/info.class.php
===================================================================
--- plog/branches/lifetype-1.1.4/class/misc/info.class.php 2006-12-23 21:43:42 UTC (rev 4422)
+++ plog/branches/lifetype-1.1.4/class/misc/info.class.php 2006-12-23 21:48:10 UTC (rev 4423)
@@ -13,14 +13,20 @@
class Info
{
/**
- * @return Returns the current memory usage, or nothing if it cannot be determined.
+ * @return Returns the peak memory usage (probably more useful, though only exists on php5)
+ or current memory usage (on PHP4),
+ or -1 if it cannot be determined.
* @static
*/
function getMemoryUsage()
{
- if( function_exists( "memory_get_usage" )) {
+ if( function_exists( "memory_get_peak_usage" )) {
+ return( memory_get_peak_usage());
+ }
+ else if( function_exists( "memory_get_usage" )) {
return( memory_get_usage());
}
+ return "";
}
/**
More information about the pLog-svn
mailing list