Thread: Mac OS X Users/C programmers?

  1. #16
    Registered User linuxdude's Avatar
    Join Date
    Mar 2003
    Location
    Louisiana
    Posts
    926
    compiled with gcc -o test test.c -lm
    Code:
    execution time for integral = 15.98 seconds
    execution time for prime = 19.25 seconds
    execution time for Goldbach = 53.5 seconds
    execution time for dynamicfnc = 5.45 seconds
    total execution time = 94.18 seconds
    sh: line 1: PAUSE: command not found
    This is a linux box(gentoo) 1.01ghz with 512mg of ram
    compiled with gcc -O3 -march=pentium3 -pipe
    Code:
    execution time for integral = 14.76 seconds
    execution time for prime = 18.54 seconds
    execution time for Goldbach = 48.64 seconds
    execution time for dynamicfnc = 5.37 seconds
    total execution time = 87.31 seconds
    sh: line 1: PAUSE: command not found

  2. #17
    Registered User
    Join Date
    Apr 2011
    Location
    Las Vegas
    Posts
    66
    Okay, the thread is quite old, but I thought it might be interesting to see what this little proggie might do on a more modern iMac8,1 with a 3.06 GHz Core 2 Duo. Program compiled with "gcc -O3 bench.c -o bench" (removed the system function call):
    Code:
    $ gcc -O3 bench.c -o bench
    $ ./bench
    execution time for integral = 1e-06 seconds
    execution time for prime = 1.73697 seconds
    execution time for Goldbach = 6.28933 seconds
    execution time for dynamicfnc = 0.605303 seconds
    total execution time = 8.63174 seconds

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 02-03-2009, 04:45 AM
  2. Mac OS X aliases
    By rak1986 in forum C Programming
    Replies: 4
    Last Post: 01-21-2009, 12:11 PM
  3. Mac OS X Programming
    By Exile in forum A Brief History of Cprogramming.com
    Replies: 14
    Last Post: 05-06-2005, 03:12 PM
  4. Assembly & Mac OS X
    By kristy in forum Tech Board
    Replies: 2
    Last Post: 07-29-2003, 04:29 PM
  5. Programming Puns
    By kermi3 in forum A Brief History of Cprogramming.com
    Replies: 44
    Last Post: 03-23-2002, 04:38 PM