How to calculate gcc compilation time?

后端 未结 2 1057
甜味超标
甜味超标 2021-01-31 10:55

I want to know GCC compile time. Does GCC have any command or option for calculate compile time?

I have a file named hello.c and will compile it. I want to know the time

2条回答
  •  误落风尘
    2021-01-31 11:22

    You can use the time utility:

    $ time gcc -c hello.c
    
    real    0m0.224s
    user    0m0.013s
    sys     0m0.010s
    

    Here's a link to the man page.

提交回复
热议问题