Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/example01/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function image_show_jpeg_only()

function after($output, $route)
{
$time = number_format( (float)substr(microtime(), 0, 10) - LIM_START_MICROTIME, 6);
$time = number_format( microtime(true) - LIM_START_MICROTIME, 6);
$output .= "\n<!-- page rendered in $time sec., on ".date(DATE_RFC822)." -->\n";
$output .= "<!-- for route\n";
$output .= print_r($route, true);
Expand Down
2 changes: 1 addition & 1 deletion examples/example03/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function before($route = array())

function after($output, $route)
{
$time = number_format( (float)substr(microtime(), 0, 10) - LIM_START_MICROTIME, 6);
$time = number_format( microtime(true) - LIM_START_MICROTIME, 6);
$output .= "\n<!-- page rendered in $time sec., on ".date(DATE_RFC822)." -->\n";
$output .= "<!-- for route\n";
$output .= print_r($route, true);
Expand Down
6 changes: 3 additions & 3 deletions lib/limonade.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
*/
define('LIMONADE', '0.5.0');
define('LIM_NAME', 'Un grand cru qui sait se faire attendre');
define('LIM_START_MICROTIME', (float)substr(microtime(), 0, 10));
define('LIM_START_MICROTIME', microtime(true));
define('LIM_SESSION_NAME', 'LIMONADE'.str_replace('.','x',LIMONADE));
define('LIM_SESSION_FLASH_KEY', '_lim_flash_messages');
if(function_exists('memory_get_usage'))
Expand Down Expand Up @@ -1837,8 +1837,8 @@ function end_content_for()
*/
function benchmark()
{
$res = array( 'execution_time' => (microtime() - LIM_START_MICROTIME) );
if(defined('LIM_START_MEMORY'))
$res = array( 'execution_time' => (microtime(true) - LIM_START_MICROTIME) );
if(defined('LIM_START_MEMORY'))
{
$current_mem_usage = memory_get_usage();
$res['current_memory'] = $current_mem_usage;
Expand Down