2
#include <stdio.h>
#include <time.h>

clock_t start, stop;

int main(){
    start = clock();
    function();
    stop = clock();
    double duration = (stop - start)/CLK_TCK;
    return 0;
}

I got a problem in Xcode. CLK_TCK undeclared. how to fix it?

XiaXuehai
  • 590
  • 1
  • 6
  • 19

1 Answers1

2

Use CLOCKS_PER_SEC instead of CLK_TCK on mac.

nick
  • 21
  • 2