How to get microseconds of system time from Redhat Linux 4.0

Answers were Sorted based on User's Feedback



How to get microseconds of system time from Redhat Linux 4.0..

Answer / 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

How to get microseconds of system time from Redhat Linux 4.0..

Answer / mahesh

what is difference between Big endian and Small Endian ????

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More Linux System Calls Interview Questions

1. Where the History file can be located? 2. How will you harden the server? 3. Diff between Raid 1 and Raid 5? 4. What is the largest disk size can be used in LVM? 5. How will you remove a PV from lvm without any data loss? 6. What is the diff between ext3 and ext2 File system? 7. How we can use resize2fs, what is the purpose? 8. What is the purpose of LVM? Why it is used? 9. If the FS is in read-only mode, so we cannot create any file. How will you fix it? 10. How to create swap partition after OS installation? 11. What is the diff between ssh and telnet? 12. How to find out the dependency required for a package?

3 Answers   IBM,


what kind of information the linux driver modules (.ko ) files has ?

2 Answers   NetApp,


how to configure sendmail server on red hat linux version 4 and what and all we Require?

3 Answers   Wipro,


what is cups and how to configure?

7 Answers   IBM,


What do fork() internally call?

3 Answers  






What is atomic function / atomic variable ?

1 Answers   Broadcom,


What is the use of proc structure?

2 Answers   NetApp,


what happens when we do insmod & rmmod in Linux Device Drivers ?

2 Answers  


how to create a ftp user on redhat linux 4.0?

6 Answers   Accenture,


what is sudo on linux?

3 Answers   IBM,


what is the difference between user APIs and kernel system calls ?

1 Answers   NetApp,


what is iptabe on redhat linux?

3 Answers   CDAC,


Categories