0

Is it possible to log the execution times of each line of code in PHP?

I'm writing a script, and I want to analyze the execution time of different components of it, mainly for trying to optimize it and generally see how much time takes every command.

Of course that I'd still need good programming skills and knowledge to optimize it well, but I'd like to see actual execution times.

I'm coming from a background in C#, and in Visual Studio going over how commands are executed was very useful when going over scripts.

Thanks in advance! I'm not very knowledgeable about the engine behind PHP.

Gal Grünfeld
  • 800
  • 3
  • 9
  • 32
  • dupe of http://stackoverflow.com/questions/2288612/how-to-trigger-xdebug-profiler-for-a-command-line-php-script – pvg Jan 31 '16 at 22:10
  • Possible duplicate of [Accurate way to measure execution times of php scripts](http://stackoverflow.com/questions/6245971/accurate-way-to-measure-execution-times-of-php-scripts) – Hatchet Jan 31 '16 at 22:37
  • Thanks. Guess I don't know how to search well here. – Gal Grünfeld Feb 01 '16 at 08:30

0 Answers0