Using clock() to measure execution time

后端 未结 3 795
遥遥无期
遥遥无期 2020-12-19 11:09

I am running a C program using GCC and a proprietary DSP cross-compiler to simulate some functioality. I am using the following code to measure the execution time of particu

3条回答
  •  轮回少年
    2020-12-19 11:49

    gettimeofday() function also can be considered.


    The gettimeofday() function shall obtain the current time, expressed as seconds and microseconds since the Epoch, and store it in the timeval structure pointed to by tp. The resolution of the system clock is unspecified.


    Calculating elapsed time in a C program in milliseconds

    http://www.ccplusplus.com/2011/11/gettimeofday-example.html

提交回复
热议问题