onlinedokumentation

KS_getSystemTime

The function KS_getSystemTime reads the time the machine is running (obsolete).

ATTENTION! THIS FUNCTION IS OBSOLETE!

C/C++
Error KS_getSystemTime(UInt64* pSystemTime);

Delphi
function KS_getSystemTime(pSystemTime: PUInt64): Error;

C#
int KS_getSystemTime(long* pSystemTime);

Parameters

pSystemTime (UInt64*)
Pointer where to store the time.

Return values

KSERROR_BAD_PARAMOne parameter is wrong.
KSERROR_FUNCTION_NOT_AVAILABLEThe chosen clock is not available.

Comments

The function reads the time the machine is running since starting the PC, where the system timer has a frequency of 1000 Hz.

This function is obsolete! You should use the function KS_getClock with the clock id KS_CLOCK_MILLISECONDS in new projects.

The function can be used on kernel-level, including real-time mode.

Example 1

KS_getMachineTime returns the current system time in 100-ns units. So, the frequency is 10 MHz.

  UInt64 machineTime;
  ksError = KS_getMachineTime(&machineTime);
  if (ksError != KS_OK)
    outputErr(ksError, "KS_getMachineTime", "Unable to get machine time.");

Example 2

See smp\ClockFunctionsLegacy.

See also