D
D
DmitryShlyomin2015-11-22 21:56:52
Laravel
DmitryShlyomin, 2015-11-22 21:56:52

Why doesn't microtime() work correctly?

I am writing a CLI utility for laravel 5.0, the code is something like this:

set_time_limit(0);
$this->exTimeStart = microtime();

....

$exTime = microtime() - $this->exTimeStart;

So, for some reason $exTime turns out to be negative . If you remove set_time_limit(0), then everything works correctly. What could be the problem? Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene, 2015-11-22
@DmitryShlyomin

microtime(true)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question