onlinedokumentation

KS_getMachineTime

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

ATTENTION! THIS FUNCTION IS OBSOLETE!

C/C++
Error KS_getMachineTime(UInt64* pMachineTime);

Delphi
function KS_getMachineTime(pMachineTime: PUInt64): Error;

C#
int KS_getMachineTime(long* pMachineTime);

Parameters

pMachineTime (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. The machine time is expressed in a frequency of 10 MHz.

This function is obsolete! You should use the function KS_getClock with the clock id KS_CLOCK_MACHINE_TIME 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