b_time.gml

来自「开放源码的编译器open watcom 1.6.0版的源代码」· GML 代码 · 共 44 行

GML
44
字号
.func _bios_timeofday
#include <bios.h>
int _bios_timeofday( int service, long *timeval );
.ixfunc2 '&BiosFunc' &func
.funcend
.desc begin
The &func function uses INT 0x1A to get or set the current
system clock value.
The values for service are:
.begterm 12
.termhd1 Value
.termhd2 Meaning
.term _TIME_GETCLOCK
Places the current system clock value in the location pointed to by
.arg 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.
.term _TIME_SETCLOCK
Sets the system clock to the value in the location pointed to by
.arg timeval.
.endterm
.desc end
.return begin
A value of -1 is returned if neither _TIME_GETCLOCK nor _TIME_SETCLOCK
were specified; otherwise 0 is returned.
.return end
.exmp begin
#include <stdio.h>
#include <bios.h>

void main()
  {
    long time_of_day;
.exmp break
    _bios_timeofday( _TIME_GETCLOCK, &time_of_day );
    printf( "Ticks since midnight: %lu\n", time_of_day );
  }
.exmp output
Ticks since midnight: 762717
.exmp end
.class BIOS
.system

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?