[Courses] using microsecond in C

Abel Pires da Silva lybel_2000 at yahoo.com
Sun Oct 20 22:47:00 EST 2002


Hi all,
I'm trying to put a time function on the program to
count how much time for the program to process
something....
Here is the code (from sneha):

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

int main( ) 
{ 
    time_t start_time; 

    start_time = time(NULL); 

    /* Your code to time */ 

   printf("Total seconds elapsed %li\n", (time(NULL) -
start_time)); 

} 

The code above is for time in SECOND, any idea how to
change it into micro/mili second?
I would be gratefull,
Thanx in advance..
Abel

__________________________________________________
Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site
http://webhosting.yahoo.com/



More information about the Courses mailing list