How to get microseconds of system time from Redhat Linux 4.0

Answer Posted / rajeev kumar verma

The systemcall "gettimeofday" can be used to get the time in microseconds. The call takes two arguments.
1- struct timeval
2- struct timezone ( for timezone information). you can have second argument null.
timeval structure has two fields:
tv_sec ( represents time in seconds)
tv_usec ( represents time in microseconds )

the code snapshot is :
////
struct timeval t_time;
gettimeofday(&t_time,NULL);

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

I would like to know whether Simado and Setu products are they EPBX or not ?

1933


Explain process management system calls in linux?

550


What are system calls used for process management in linux?

585


what are different ways the context switch happens from user to kernel space or vice-versa ?

2140