Speed Test PHP

In previous post I examine Java, Scala and Groovy speed on my computer, as alternative see how it can be done in PHP:

<?php
time2();

function time2(){

    $start = mktime();
    for($i = 0; $i < 100; $i++){
        for($j = 0; $j < 100; $j++){
            for($k = 0; $k < 100; $k++){
                for($l = 0; $l < 100; $l++){
                    $i+$j+$k+$l;
                }
            }
        }
    }

    echo (int)(mktime() - $start);
}
?>

Response:
32 s
34
37
36

...
~33 seconds!!!!
Groovy has half of it, Scala 1/5... Java: No Comment!

Regards,
Krzysiek Kula

Posted via email from krzychukula's posterous

Comments

Popular posts from this blog

How to simulate slow connection (developer proxy in Node.js)

How to use NPM packages from private repositories on bitbucket