I'm wondering if there is a way to know the time each function takes to execute within my php script ?
The script contain functions like (if conditions - for loop - connections to the DB using PDO).
for example I have something like that :
<?php
$link = $_POST['url'];
$links = array();
for($i = 1; i < 9; i++){
  array_push($links , $link . 'page' . $i);
}
foreach($links as $lin){
  //PDO connection to the DB , It's not written right
  $statement = 'SELECT * from links WHERE link = :zlink';
  zlink = $lin;
  $count = $statement->rowCount();
  if($count > 1){
    // do something
  }else{
    'INSERT INTO links WHERE link = :mlink';
    mlink = $lin;
    file_put_contents();
  }
}
and more other functions , So is it possible to know how much each of these functions take? and what takes much time ?