Steinar H. Gunderson wrote:
> On Thu, Jun 07, 2007 at 11:31:20PM +0200, Steinar H. Gunderson wrote:
> 
>>For comparison, a hastily coded version of the sieve of Eratosthenes
>>finished in half a CPU second. A sieve of Atkin would probably be faster
>>still.
> 
> 
> FWIW, here's the (C99) program I used, for reference. I verified that it
> generates correct results by commenting in the printfs and comparing against
> the UNIX "primes" command.

$ time ./primes1
664579 primes found.

real    0m2.639s
user    0m1.395s
sys     0m0.030s

This machine is heavily CPU loaded, which explains the difference
between real and user+sys. So, on my machine your program took
1.425 seconds.

$ cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 15
model           : 2
model name      : Intel(R) Celeron(R) CPU 2.70GHz
stepping        : 9
cpu MHz         : 2700.495
cache size      : 128 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca 
cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe cid xtpr
bogomips        : 5324.80

Mike
-- 
p="p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
Oppose globalization and One World Governments like the UN.
This message made from 100% recycled bits.
You have found the bank of Larn.
I can explain it for you, but I can't understand it for you.
I speak only for myself, and I am unanimous in that!
_______________________________________________
Prime mailing list
[email protected]
http://hogranch.com/mailman/listinfo/prime

Reply via email to