Thursday, 4 December 2014

How to find execution time for a script in PHP

if your are a PHP dev and you execute php scripts to test time taken, the following code can help you


microtime — Return current Unix timestamp with microseconds



[php]
//Start time
$time_start = microtime(true);

// Sleep for 1 sec
sleep(1);

//Execution of your script

//End time
$time_end = microtime(true);

//Time taken
$time = $time_end - $time_start;

echo "Time taken is $time seconds\n";

[/php]

Hope this will be useful in your application
Ref

17 comments:

  1. Hello Admin, thank you for enlightening us with your knowledge sharing. PHP has become an inevitable part of web development, and with proper PHP Training in Chennai, one can have a strong career in the web development field. We from Fita provide PHP course in Chennai with the best facilitation. Any aspiring students can join us for the best Best PHP training in chennai

    ReplyDelete
  2. It really useful to me to find execution time in PHP.
    Thanks,
    JAVA Training in Chennai|Java Courses in Chennai

    ReplyDelete
  3. Well Said, you have furnished the right information that will be useful to anyone at all time. Thanks for sharing your Ideas.
    PHP Training in Chennai | PHP Course in Chennai

    ReplyDelete
  4. I was working on the responsive design and this article provided me the lot of information about designing of website. Using this information i can create the look and feel websites.
    PHP Training in Chennai | PHP Course in Chennai

    ReplyDelete
  5. This very technical information by Admin Thanks for Share the post
    PHP Training in Gurgaon | PHP Training Institute in gurgaon

    ReplyDelete
  6. Impressive blog with lovely information. really very useful blog for us thanks for sharing such a wonderful blog... 
    Best Java Training Institute in Chennai | DotNet Training Institute in Chennai | Web Designing Training Institute in Chennai

    ReplyDelete
  7. I really enjoyed while reading your article, the information you have delivered in this post was good. Keep sharing your post with efficient news.
    No.1 Java Project Center in Chennai | Best Dot Net Projects in Chennai | Best Mini Project Center in Chennai


    ReplyDelete
  8. Impressive blog with lovely information.It's really very useful blog for us thanks for sharing such a wonderful blog... 
    Best Android Training Institute in Chennai | DotNet Training Institute in Chennai | Web Designing Training Institute in Chennai

    ReplyDelete
  9. This is excellent information. It is amazing and wonderful to visit your site.Thanks for sharing this information, this is useful to me…
    Best Final Year Project Center in Chennai | No.1 Diploma Project in Chennai | Best BBA/MBA Project Center in Chennai

    ReplyDelete
  10. Impressive blog with great content, you explained everything in detailed manner. Thanks a lot for share such a nice article. Linux Training in Chennai | Unix Training in Chennai | Python Training in Chennai

    ReplyDelete
  11. Nice and good article.. it is very useful for me to learn and understand easily.. thanks for sharing your valuable information and time.. please keep updating.
    No.1 Software Testing Training Institute in Chennai | Best Selenium Training Institute in Chennai | ISTQB Certification Center in Velachery

    ReplyDelete
  12. Thanks for your great information! Its interesting and informative..
    VLSI Project Center in Chennai | VLSI Project Center in Velachery

    ReplyDelete
  13. Thanks a lot for sharing this with all of us, I like it and we can communicate. Do you need buy app ratings and reviews. To boost app ranking and double app downloads now.

    ReplyDelete