in reply to Re: Number gussing game
in thread Number gussing game

How are you timing it? Consider:

print time, "\n"; 1 for 1 .. 1000000000; print time, "\n";

is just a loop, but takes a while to run (about 48 seconds on my system) and can be timed accurately enough as shown. You loop executes in about 10 micro seconds (timed over 1 million iterations) which doesn't seem excessively slow to me.


DWIM is Perl's answer to Gödel

Replies are listed 'Best First'.
Re^3: Number gussing game
by juwaidah1990 (Initiate) on Jun 30, 2007 at 19:54 UTC
    May be it's a problem in my pc, the loop took 184 seconds, which is almost 4 times slower than your machine :) Thank you all for your participation, Cheers!

      So your number guessing program would take about 4/1000 of a second to chech the 100 numbers on your system. That doesn't sound too long to wait. What's the problem and again: how did you time it?


      DWIM is Perl's answer to Gödel