2007年4月13日金曜日

C Compiler Test

所要時間: 10分程度

動作環境
  • MacBook Pro(Core Duo 2.0GHz, 2GB Memory)
  • Mac OS X 10.4.9
  • GCC Version
$ gcc -v
Using built-in specs.
Target: i686-apple-darwin8
Configured with: /private/var/tmp/gcc/gcc-5363.obj~28/src/configure --disable-checking -enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.0/ --with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/lib --build=powerpc-apple-darwin8 --with-arch=nocona --with-tune=generic --program-prefix= --host=i686-apple-darwin8 --target=i686-apple-darwin8
Thread model: posix
gcc version 4.0.1 (Apple Computer, Inc. build 5363)

  • Program Source
$ cat hello.c
#include

int main(){
printf("Hello, world.");
return 0;
}

  • Compile Time
$ time gcc hello.c

real 0m0.119s
user 0m0.048s
sys 0m0.057s

  • Execution Time
$ time ./a.out
Hello, world.
real 0m0.027s
user 0m0.001s
sys 0m0.006s

0 件のコメント: