• Home
  • ZarxBiz
  • Forum
Igniter Code
IgniterCode.com === Zarx.Biz
ReactJS

ecommerce cart react source code 2022 [ For Beginners ]

October 8, 2022 0 comment

Why and how to use sql views 2022

August 22, 2022 0 comment

how to import csv to mysql using php

August 22, 2022 0 comment
PHP

Code faster using visual studio Updated 2022

July 31, 2022 0 comment

Web socket crash course 2022 updated step by step

July 3, 2022 0 comment

How to use stored procedure in sql updated 2022

September 3, 2022 0 comment
MySQL

Must know mysql functions updated 2022

September 3, 2022 0 comment

PHP Composer Autoload Complete Guide 2022

August 13, 2022 0 comment
Tag:

memory usage php

php application performance monitoring 2022
PHP

php application performance monitoring 2022

by Manu August 6, 2022
written by Manu

Php is one of the most famous language these days. Php rules the web. But it is important to have your PHP code clean and monitored so you get best out of PHP application.

In this guide we are going to take about 2 things.

  1. Monitoring Performance.
  2. Execution time.

For monitoring performance we can use these functions.

memory_get_usage and memory_get_peak_usage functions.

Memory Usage in PHP

memory_get_usage: This function will show us memory used for php while executing script.

memory_get_peak_usage: This function returns maximum memory used in script.
You can call these functions to see memory usage and then can modify your code to improve performance.

Execution Time in PHP

For checking execution time we have a function just add it on start of script and end of script and it will show you the execution time for both points

 

$startExecutionTime = getExecutionTime();
$endExecutionTime = getExecutionTime();

/**
 * GEt script start and end time.
 *
 * @return void
 */
function getExecutionTime()
{
    return microtime(true);
}

/**
/**
 * Get script execution time.
 */
function getProcessTime($startExecutionTime, $endExecutionTime)
{
    $diff = $endExecutionTime - $startExecutionTime;


    return 'Time taken to process code: '. date("H:i:s", $diff);
}

Note in above code we are passing $startExecutionTime.

Now to get start time put “$startExecutionTime = getExecutionTime” at start of your script and

put “$endExecutionTime = getExecutionTime” at the end of your script. Check our video guide for practical visual execution.

Download Files

August 6, 2022 0 comment
0 FacebookTwitterPinterestEmail

Recent Posts

  • ecommerce cart react source code 2022 [ For Beginners ]
  • How to use stored procedure in sql updated 2022
  • Must know mysql functions updated 2022
  • Why and how to use sql views 2022
  • how to import csv to mysql using php

Recent Comments

No comments to show.
  • Facebook
  • Twitter
  • Youtube
  • Email

@2022 - All Right Reserved


Back To Top
Igniter Code
  • Home
  • ZarxBiz
  • Forum