How to get microseconds of system time from Redhat Linux 4.0?
Submitted by: AdministratorThe 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);
Submitted by: Administrator
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);
Submitted by: Administrator
Read Online System Calls Job Interview Questions And Answers
Top System Calls Questions
☺ | What happens when we do insmod & rmmod in Linux Device Drivers? |
☺ | What are the different ways the Linux can switch from User Space to Kernel Space & vice-versa? |
☺ | Difference between Raid 1 and Raid 5? |
☺ | What kind of information the Linux driver modules (.ko ) files has? |
☺ | What is the largest disk size can be used in LVM? |
Top Linux OS Categories
☺ | Device Drivers Interview Questions. |
☺ | Linux OS Management Interview Questions. |
☺ | Linux Makefile Interview Questions. |
☺ | Linux Environment Interview Questions. |
☺ | Linux OS Shell Interview Questions. |