microtime for seconds

Asked

Viewed 209 times

0

I’m checking how long a API delay to respond and I’m picking up the values at the beginning with microtime(true) and at the end with microtime(true) therefore;

$start = microtime(true);
...
...
...
...
$end = microtime(true);

To convert to seconds the current code divides the subtraction of the values by 60:

($end - $start) / 60

But I’ve done a lot of research and all I can find is to divide the value by 1000000, how do I get the difference of these values in segundos?

  • 1

    But with the ($end - $start) you already get the right seconds?

  • You’ve tried it this way date("s", $end - $start); ?

  • @I_like_trains I don’t know rs, so the question.

  • https://stackoverflow.com/a/6468171/6510304

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.