How can I express 10 milliseconds using timeval?
This is what I have so far:
struct timeval now;
now.tv_usec =10000;
How can I express 10 milliseconds using timeval?
This is what I have so far:
struct timeval now;
now.tv_usec =10000;
A struct timeval
represents a time as a number of seconds (tv_sec
) plus a number of microseconds (tv_usec
) between 0 and 1,000,000. Thus, to represent 10 milliseconds, you would use 10,000 microseconds, as you suggested:
struct timeval tv;
tv.tv_sec = 0;
tv.tv_usec = 10000;
it's
struct timeval {
int tv_sec; // seconds
int tv_usec; // microseconds!
so now.
tv_sec = 0;
tv_usec = 10000;
` would be right
i need to knw execution time of my program which writen in c languge at linux enviornment/....pls any one help..itz urgent......