Runtime I know answer, now if the performance (performance) is good, taking into account the runtime, I believe it depends more than your algorithm does, make an analysis of complexity and etc.
At the beginning of the algorithm:
$time_start = microtime(true); // Inicializa a variável $time no inicio do seu script
.
.
{seu código aqui}
.
.
$time_end = microtime(true);
$time = $time_end - $time_start;
echo $time; // Te traz o tempo em milissegundos de execução do algorítimo
In a script that picked up various data from another server, it brought me the runtime of 59s - 65s for example.
Performance can be measured by the amount of loops
, number of recursive functions, number of similar functions that could be grouped, I believe it is worth taking a look at articles on algorithm complexity, which is a very extensive engineering/science subject.
Article on the complexity of algorithms
Resource consumption, there are internal commands on a server (linux, windows, among others) that can be used to analyze the amount of resources consumed during the execution time of a script, unfortunately I do not have much experience in the subject, but there are some questions here in the network that can help.