Thursday 15 March 2012

Calculate time taken for execution of php script or web page

Hi,

Often working on a website, it is quite necessary to check the execution speed of the script. As it's the most essential part of a website in terms of user experience that a web page loads as quick as possible.

I used to stuck to such situation, where I want to update my script functionality but not sure how it's gonna affect scripts execution speed. Here is wonderful script that I use to find out how much time it takes to execute the script.

<?php
$curTime = microtime();
$curTime = explode(' ', $curTime);
$strTime = $curTime[1] + $curTime[0];
/********************************************/
/********* PLACE YOUR CODE HERE **********/
/********************************************/ 

$curTime = microtime();
$curTime = explode(' ', $curTime);
$finTime = $curTime[1] + $curTime[0];
$totTime = round(($finTime - $strTime), 6);
echo 'Script took '.$totTime.' seconds to execute.'."\n";
?>

Monday 12 March 2012

Facebook server down today

Yes, that's right. facebook is down and not accessible today for quite sometime in india. Any official announcement or clarification are not made up till now for the problem. But it is speculated that it may be because of Indian government ban on facebook related to some content not being censored by facebook. Another speculation is that it may be because DDoS attack by hackers. Still nothing is clear.

You can access facebook on m.facebook.com, that is mobile version of facebook.

Facebook was earlier not accessible on 25th February, but that was only for short while. But today it has been down for quite long time. No clarification was given for the problem occurred on 25th February with facebook. Facebook is the most famous social networking site with more than 800 million users worldwide. It is famous for it's sleek user interface and impressive user experience. This is the first time that facebook severs are down for so long.

Hope to see facebook back again soon.