Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
That's great! VBO actually helps you go back in time!!
Can you give more details about how you got this result?
What's the date of download of the release you're using?
"Interesting quirk (tested in PHP 5.0.3): You can get very wacky results from microtime when it is called in the destructor of an object at the end of a script. These times vary enormously and can be in the *past*, when compared to microtime calls in the body of the script.
As a case example, I played with a timer object that measured microtime when it was created at the start of the script, and measured microtime again at the end of the script using __destruct(); and then printed the total execution time (end time - start time) at the bottom of the page. On short scripts, this would often give a negative time!
...
"
It's written that it not happen only on PHP4. I've tested it on Xeon with 4 processors (unfortunatelly with PHP4), so execution of script could be very fast.
Thanks for your research. VBO is not designed to work on PHP 4, so you might run into other issues on this version. I'll keep the code as is for the time being.
Comments
Comment #1
infojunkieThat's great! VBO actually helps you go back in time!!
Can you give more details about how you got this result?
What's the date of download of the release you're using?
Comment #2
kenorb commentedIt happen once, I'll let you know when it will happen again.
I'll try to reproduce it later again.
http://www.csgnetwork.com/unixds2timecalc.html
Comment #3
kenorb commentedIt can be rewritten by:
Comment #4
infojunkieYou mean you encountered the negative time again? Or are you just suggesting a general way to rewrite the timing code?
Comment #5
kenorb commentedYes, it happened me couple of times.
I can debug it if this will happen again.
Comment #6
kenorb commentedI think it's PHP5 compability and it happen only on PHP4.
I couldn't reproduce it on PHP5 environment.
It's because the code looks like:
Where microtime() argument has been added in PHP 5.0
http://uk2.php.net/microtime
There is some solution to be compatible, but I haven't test it:
http://uk2.php.net/manual/en/function.microtime.php#61838
So the only solution to make it compatible is to rewrite the timing code.
If somebody is happy to do that, please change the status.
Comment #7
kenorb commentedRead as well this comment:
http://uk2.php.net/manual/en/function.microtime.php#50300
"Interesting quirk (tested in PHP 5.0.3): You can get very wacky results from microtime when it is called in the destructor of an object at the end of a script. These times vary enormously and can be in the *past*, when compared to microtime calls in the body of the script.
As a case example, I played with a timer object that measured microtime when it was created at the start of the script, and measured microtime again at the end of the script using __destruct(); and then printed the total execution time (end time - start time) at the bottom of the page. On short scripts, this would often give a negative time!
...
"
It's written that it not happen only on PHP4. I've tested it on Xeon with 4 processors (unfortunatelly with PHP4), so execution of script could be very fast.
Comment #8
infojunkieThanks for your research. VBO is not designed to work on PHP 4, so you might run into other issues on this version. I'll keep the code as is for the time being.
Comment #9
infojunkie