0

i have following code

#include <iostream> #include <time.h> #include <stdlib.h> #include <stdio.h> int main(){ //nanoseconds int x,y; x=6700; y=10000; int z=0; clock_t t =clock(); while (y!=0){ z+=x<<2; x=x>>2; y>>=2; } t=clock()-t; t=1000*t/CLOCKS_PER_TICK; printf("%d\n",t); } 

but it writes that

1>c:\users\david\documents\visual studio 2010\projects\nano_seconds\nano_seconds.cpp(20): error C2065: 'CLOCKS_PER_TICK' : undeclared identifier 

but i have read that there exist in c++ such keyword

3 Answers 3

2

Even Google knew the answer to this one:

http://www.google.com/search?q=CLOCKS_PER_TICK

Did you mean: CLOCKS_PER_SEC

Sign up to request clarification or add additional context in comments.

Comments

0

I believe you're looking for CLOCKS_PER_SEC.

Comments

0

You are thinking of CLOCKS_PER_SEC

Comments