0

C: Getting the time in Nano Seconds

Posted by Joys of Programming on in C/C++

clock_gettime() returns the time in seconds and nanoseconds since the epoch. The value returned can only be used in conjunction with each other. The following program shows this To compile this program And execute the program

Tags: , ,

 
0

C: Printing Current System Time

Posted by Joys of Programming on in C/C++

There are multiple functions using which you can get the current system time in seconds like gettimeofday().But usage of clock_gettime() is recommended. clock_gettime() returns the number of seconds and nano seconds since the Epoch (January 1, 1970). It’s syntax is where clk_id can take values like CLOCK_REALTIME (which we will use in the current program [...]

Tags: , , , ,

Copyright © 2009-2012 Joys of Programming All rights reserved.
Desk Mess Mirrored v1.8.1 theme from BuyNowShop.com.