Skip to content

Latest commit

 

History

History
24 lines (20 loc) · 1.17 KB

File metadata and controls

24 lines (20 loc) · 1.17 KB

Fizz buzz

My first python script (and php-version also to compare speed). I did run those scripts in console and saw some difference in performance.

PHP

  • It took 0 milliseconds to run 10 rounds in Fizz buzz game.
  • It took 0 milliseconds to run 100 rounds in Fizz buzz game.
  • It took 0 milliseconds to run 1000 rounds in Fizz buzz game.
  • It took 2 milliseconds to run 10000 rounds in Fizz buzz game.
  • It took 20 milliseconds to run 100000 rounds in Fizz buzz game.
  • It took 203 milliseconds to run 1000000 rounds in Fizz buzz game.
  • It took 2032 milliseconds to run 10000000 rounds in Fizz buzz game.

PYTHON

  • It took 0 milliseconds to run 10 rounds in Fizz buzz game.
  • It took 0 milliseconds to run 100 rounds in Fizz buzz game.
  • It took 1 milliseconds to run 1000 rounds in Fizz buzz game.
  • It took 3 milliseconds to run 10000 rounds in Fizz buzz game.
  • It took 36 milliseconds to run 100000 rounds in Fizz buzz game.
  • It took 362 milliseconds to run 1000000 rounds in Fizz buzz game.
  • It took 3632 milliseconds to run 10000000 rounds in Fizz buzz game.

It seems that python is some reason little bit slower.

See about Fizz buzz in here, http://en.wikipedia.org/wiki/Fizz_buzz