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 Library Reference - <u>synopsis:</u> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <bios.h>
    int _bios_timeofday( int service, long *timeval );

Description:
    The _bios_timeofday function uses INT 0x1A to get or set the current
    system clock value.  The values for service are:

    Value     Meaning

_TIME_GETCLOCK
    Places the current system clock value in the location pointed to by
    timeval.  The function returns zero if midnight has not passed since the
    last time the system clock was read or set; otherwise, it returns 1.

_TIME_SETCLOCK
    Sets the system clock to the value in the location pointed to by
    timeval.


Returns:
    A value of -1 is returned if neither _TIME_GETCLOCK nor _TIME_SETCLOCK
    were specified; otherwise 0 is returned.

Example:
    #include <stdio.h>
    #include <bios.h>

    void main()
      {
        long time_of_day;

        _bios_timeofday( _TIME_GETCLOCK, &time_of_day );
        printf( "Ticks since midnight: %lu\n", time_of_day );
      }

    produces the following:

    Ticks since midnight: 762717

Classification:
    BIOS

Systems:
    DOS, Windows, Win386

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