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

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

0 Answers   Alcatel,


if root user forget the password how to change it?

4 Answers   Wipro,


what are the different ways the Linux can swich from User Space to Kernel Space & vice-versa ?

2 Answers   NetApp,


What is atomic function / atomic variable ?

1 Answers   Broadcom,


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

1 Answers   NetApp,






diff b/w spinlock, seamaphores and mutex and where to use it.

2 Answers   Intel,


why the kernel panic error was appering?

13 Answers   Air2Web, Allianz,


linux file defaults permition

8 Answers  


How to give the root permision to users?

3 Answers   Wipro,


1.Diff between Active and passive FTP? 2.What is anacron? 3.Diff between yum update and yum install while doing for kernel? 4.root_squash and no_root_squash does what? 5.What are the commands will you execute to find a new hardware? 6.How will you find out a lun allocated from SAN? 7.What is the main diff in CaT5 and CAT6 cable, except the 1/100 and 1/1000? 8.What is stale NFS and How will you fix it? 9.What is kernel panic error? 10.How will you recover password and shadow file, in case both got deleted. Explain the steps? 11.Explain boot process 12.What is network bonding. Explain the steps? 13.What are the exit codes returned by FSCK? 14.What is LDOM? 15.Diff between block and character device?

2 Answers   Wipro,


Port number is already in use .. how to fix for apache..?

1 Answers   Google,


what are the backup utilites on red hat linux 4.0?

4 Answers   Wipro,


Categories