PcGetTimeInterval function (portcls.h)

The PcGetTimeInterval function returns the time elapsed since a specified time. Time is measured in 100-nanosecond units.

Syntax

PORTCLASSAPI ULONGLONG PcGetTimeInterval(
  [in] ULONGLONG Since
);

Parameters

[in] Since

Specifies the time from which to measure the interval. Typically, this function is called once with a "since" of zero to get the current time, and is called subsequently with a "since" of the recorded current time to get time intervals from that time.

Return value

PcGetTimeInterval returns the current time minus Since.

Remarks

The value that is specified in parameter Since is measured in 100-nanosecond units. If Since is zero, the time returned is the number of 100-nanosecond ticks since January 1, 1601. The time units are the same as those used to specify the system time in the KeQuerySystemTime function.

The following macros from portcls.h are useful for converting seconds, milliseconds, and microseconds to 100-millisecond units:

GTI_SECONDS

GTI_MILLISECONDS

GTI_MICROSECONDS

This function can be used for timing purposes by first saving the current time,

  ULONGLONG ullTime = PcGetTimeInterval(0);

and then checking to see whether the required interval has passed

  if (PcGetTimeInterval(ullTime) >= GTI_MILLISECONDS(5))

Requirements

Requirement Value
Minimum supported client The PortCls system driver implements the PcGetTimeInterval function in Microsoft Windows 98/Me and in Windows 2000 and later operating systems.
Target Platform Universal
Header portcls.h (include Portcls.h)
Library Portcls.lib
IRQL Any level

See also

KeQuerySystemTime