Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

gettimeofday(3p) [centos man page]

GETTIMEOFDAY(3P)					     POSIX Programmer's Manual						  GETTIMEOFDAY(3P)

PROLOG
This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the correspond- ing Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux. NAME
gettimeofday - get the date and time SYNOPSIS
#include <sys/time.h> int gettimeofday(struct timeval *restrict tp, void *restrict tzp); DESCRIPTION
The gettimeofday() function shall obtain the current time, expressed as seconds and microseconds since the Epoch, and store it in the timeval structure pointed to by tp. The resolution of the system clock is unspecified. If tzp is not a null pointer, the behavior is unspecified. RETURN VALUE
The gettimeofday() function shall return 0 and no value shall be reserved to indicate an error. ERRORS
No errors are defined. The following sections are informative. EXAMPLES
None. APPLICATION USAGE
None. RATIONALE
None. FUTURE DIRECTIONS
None. SEE ALSO
ctime(), ftime(), the Base Definitions volume of IEEE Std 1003.1-2001, <sys/time.h> COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1, 2003 Edition, Standard for Information Technol- ogy -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html . IEEE
/The Open Group 2003 GETTIMEOFDAY(3P)

Check Out this Related Man Page

MEMSET(3P)						     POSIX Programmer's Manual							MEMSET(3P)

PROLOG
This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the correspond- ing Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux. NAME
memset - set bytes in memory SYNOPSIS
#include <string.h> void *memset(void *s, int c, size_t n); DESCRIPTION
The memset() function shall copy c (converted to an unsigned char) into each of the first n bytes of the object pointed to by s. RETURN VALUE
The memset() function shall return s; no return value is reserved to indicate an error. ERRORS
No errors are defined. The following sections are informative. EXAMPLES
None. APPLICATION USAGE
None. RATIONALE
None. FUTURE DIRECTIONS
None. SEE ALSO
The Base Definitions volume of IEEE Std 1003.1-2001, <string.h> COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1, 2003 Edition, Standard for Information Technol- ogy -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html . IEEE
/The Open Group 2003 MEMSET(3P)
Man Page

4 More Discussions You Might Find Interesting

1. Programming

the problem of gettimeofday

Hi all, I just wrote a small problem to check gettimeofday in a multi-cores environment. int timediff(double fTimeQvs, double fTimeTcp) { int iTimeDiff; iTimeDiff = (((((int)fTimeQvs)/10000) - (((int)fTimeTcp)/10000)) * 3600) * 1000000; iTimeDiff +=... (17 Replies)
Discussion started by: dophine
17 Replies

2. Programming

Gettimeofday problem

i have written the code in which i want to calculate timedifference of request sent time and response receive time from device in second and microsecond. but when i executes the binary i get the response receive time earlier than request sent time which in turn returns the negative time difference.... (3 Replies)
Discussion started by: kailas.awchar
3 Replies

3. Programming

smallest resolution using gettimeofday() in C

Hello ... Can somebody help telling me how smallest clock resolution on ones sytem can be in obtained in C using gettimeofday() . Thankz in advance... (4 Replies)
Discussion started by: harsha10
4 Replies

4. Programming

How use pthread_cond_timedwait without clock_gettime?

I need to use pthread_cond_timedwait, which is available in my old embedded Linux for PPC. But I don't have clock_gettime... So, I build this replacement for clock_gettime, and it seems to work: #include <sys/time.h> #include <time.h> int clock_gettime_replacement(struct timespec *now) {... (1 Reply)
Discussion started by: fcolombo
1 Replies