1FTIME(3P)                  POSIX Programmer's Manual                 FTIME(3P)
2
3
4

PROLOG

6       This  manual  page is part of the POSIX Programmer's Manual.  The Linux
7       implementation of this interface may differ (consult the  corresponding
8       Linux  manual page for details of Linux behavior), or the interface may
9       not be implemented on Linux.
10

NAME

12       ftime - get date and time (LEGACY)
13

SYNOPSIS

15       #include <sys/timeb.h>
16
17       int ftime(struct timeb *tp);
18
19

DESCRIPTION

21       The ftime() function shall set the time  and  millitm  members  of  the
22       timeb  structure  pointed to by tp to contain the seconds and millisec‐
23       onds portions, respectively, of the current time in seconds  since  the
24       Epoch.  The  contents of the timezone and dstflag members of tp after a
25       call to ftime() are unspecified.
26
27       The system clock need not have millisecond  granularity.  Depending  on
28       any  granularity  (particularly a granularity of one) renders code non-
29       portable.
30

RETURN VALUE

32       Upon successful completion, the ftime() function shall return 0; other‐
33       wise, -1 shall be returned.
34

ERRORS

36       No errors are defined.
37
38       The following sections are informative.
39

EXAMPLES

41   Getting the Current Time and Date
42       The  following  example shows how to get the current system time values
43       using the ftime() function. The timeb structure pointed  to  by  tp  is
44       filled with the current system time values for time and millitm.
45
46
47              #include <sys/timeb.h>
48
49
50              struct timeb tp;
51              int          status;
52              ...
53              status = ftime(&tp);
54

APPLICATION USAGE

56       For  applications  portability,  the  time() function should be used to
57       determine the current time instead of  ftime().  Realtime  applications
58       should  use  clock_gettime()  to  determine the current time instead of
59       ftime().
60

RATIONALE

62       None.
63

FUTURE DIRECTIONS

65       This function may be withdrawn in a future version.
66

SEE ALSO

68       clock_getres(), ctime(), gettimeofday(), time(), the  Base  Definitions
69       volume of IEEE Std 1003.1-2001, <sys/timeb.h>
70
72       Portions  of  this text are reprinted and reproduced in electronic form
73       from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
74       --  Portable  Operating  System  Interface (POSIX), The Open Group Base
75       Specifications Issue 6, Copyright (C) 2001-2003  by  the  Institute  of
76       Electrical  and  Electronics  Engineers, Inc and The Open Group. In the
77       event of any discrepancy between this version and the original IEEE and
78       The  Open Group Standard, the original IEEE and The Open Group Standard
79       is the referee document. The original Standard can be  obtained  online
80       at http://www.opengroup.org/unix/online.html .
81
82
83
84IEEE/The Open Group                  2003                            FTIME(3P)
Impressum