I'm trying to measure the time it takes my program to perform multiple operations in a loop and the entire program is written in C. I'm using the method from this post:
C# vs C - Big performance difference
However, when I try doing that method, on the declaration line for clock(), I get an error: Improper use of typedef symbol in function main.
The header file is included and does not cause any errors. This is a 16-bit C program written in the TurboC compiler for MS-DOS. I'm not sure which version of C it's using, but I think it's most likely C89 or one of the earlier versions of C. I don't know if that causes any syntax differences or not?
Here's the code I'm using:
clock_t start = clock();
while(count < 10000)
{
count++;
}
printf("Time elapsed: %f\n", ((double)clock() - start) / CLOCKS_PER_SEC);
And the error is exactly as I mentioned above.