Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C/C++ v10.0 : C library - <b>synopsis:</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <sys\timeb.h>
    int ftime( struct timeb *timeptr );

    struct timeb {
     time_t time;  /* time in seconds since Jan 1, 1970 UTC */
     unsigned short millitm; /* milliseconds */
     short timezone; /* difference in minutes from UTC */
     short dstflag;  /* nonzero if in daylight savings time */
    };

Description:
    The ftime function gets the current time and stores it in the structure
    pointed to by timeptr.

Returns:
    The ftime function fills in the fields of the structure pointed to by
    timeptr.  The ftime function returns -1 if not successful, and a
    non-zero value otherwise.

See Also:
    asctime Functions, clock, ctime Functions, difftime, gmtime Functions, localtime Functions, mktime, strftime,
    time, tzset

Example:
    #include <stdio.h>
    #include <time.h>
    #include <sys\timeb.h>

    void main()
      {
        struct timeb timebuf;
        char   *tod;

        ftime( &timebuf );
        tod = ctime( &timebuf.time );
        printf( "The time is %.19s.%hu %s",
            tod, timebuf.millitm, &tod[20] );
      }

    produces the following:

    The time is Tue Dec 25 15:58:42.870 1990

Classification:
    WATCOM

Systems:
    All

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson