Jump to content

DosTmrQueryTime: Difference between revisions

From EDM2
Ak120 (talk | contribs)
No edit summary
Line 3: Line 3:


==Syntax==
==Syntax==
<PRE>
  DosTmrQueryTime(pqwTmrTime);
#define INCL_DOSPROFILE
#include <os2.h>
 
PQWORD    pqwTmrTime;  /*  Time. */
APIRET    rc;          /* Return Code. */
 
rc = DosTmrQueryTime(pqwTmrTime);
</PRE>


==Parameters==
==Parameters==
;pqwTmrTime (PQWORD) - output : Time.
;pqwTmrTime (PQWORD) - output : Time.
A snapshot of the time from the IRQ0 high resolution timer.
A snapshot of the time from the IRQ0 high resolution timer.
It is a pointer, supplied by the calling application, to the following structure:
      typedef struct _QWORD {
          [[ULONG]] ulLo,
          ULONG ulHi,
      } QWORD;
      typedef QWORD *PQWORD;


==Return Code==
==Return Code==
Line 25: Line 24:
* 99 ERROR_DEVICE_IN_USE
* 99 ERROR_DEVICE_IN_USE
* 536 ERROR_TMR_INVALID_TIME
* 536 ERROR_TMR_INVALID_TIME
==Example Source Code==
Calling example:
<PRE>
#define INCL_DOSPROFILE
#include <os2.h>
PQWORD    pqwTmrTime;  /*  Time. */
APIRET    rc;          /*  Return Code. */
rc = DosTmrQueryTime(pqwTmrTime);
</PRE>
Use Example:
<PRE>
/*
  * Description: Display high resolution system time.
  */
  #define INCL_DOS
  #define INCL_DOSERRORS
  #include <os2.h>
  #include <stdio.h>
  VOID
  main()
  {
    QWORD qwTime;
    ULONG rc;
          if ((rc = DosTmrQueryTime(&qwTime)) != NO_ERROR)
                  printf("\nERROR (DosTmrQueryTime): %d\n", rc);
          else
                  printf("Time = 0x %08lx %08lx\n",
                          qwTime.ulHi, qw
</PRE>


==Related Functions==
==Related Functions==

Revision as of 18:15, 24 August 2017

Description

Provides a snapshot of the time from the IRQ0 high resolution timer (Intel 8254).

Syntax

DosTmrQueryTime(pqwTmrTime);

Parameters

pqwTmrTime (PQWORD) - output
Time.

A snapshot of the time from the IRQ0 high resolution timer.

It is a pointer, supplied by the calling application, to the following structure:

     typedef struct _QWORD { 
         ULONG ulLo,
         ULONG ulHi,
     } QWORD;
     typedef QWORD *PQWORD;

Return Code

rc (APIRET) - returns

DosTmrQueryTime returns the following values:

  • 0 NO_ERROR
  • 87 ERROR_INVALID_PARAMETER
  • 53 ERROR_TMR_NO_DEVICE
  • 99 ERROR_DEVICE_IN_USE
  • 536 ERROR_TMR_INVALID_TIME

Example Source Code

Calling example:

#define INCL_DOSPROFILE
#include <os2.h>

PQWORD    pqwTmrTime;  /*  Time. */
APIRET    rc;          /*  Return Code. */

rc = DosTmrQueryTime(pqwTmrTime);

Use Example:

 /*
  * Description: Display high resolution system time.
  */

  #define INCL_DOS
  #define INCL_DOSERRORS

  #include <os2.h>
  #include <stdio.h>

  VOID 
  main()
  { 
    QWORD qwTime;
    ULONG rc;

          if ((rc = DosTmrQueryTime(&qwTime)) != NO_ERROR)
                  printf("\nERROR (DosTmrQueryTime): %d\n", rc);
          else 
                  printf("Time = 0x %08lx %08lx\n",
                          qwTime.ulHi, qw

Related Functions