NXGetTime

Returns the elapsed time.

Library:LibC
Classification:NKS
Service:Time

Syntax

  #include <nks/time.h> 
   
  int NXGetTime (
     int         epoch,
     int         units,
     NXTime_t   *time);
  

Parameters

epoch

(IN) Specifies the time that is to be returned:

Flag

Value

Description

NX_SINCE_BOOT

0

Time since boot

NX_SINCE_1970

1

Time since the epoch (0:00:00 UTC, January 1, 1970)

units

(IN) Specifies the units in which the time is to be returned:

Flag

Value

Description

NX_TICKS

-1

Ticks

NX_SECONDS

0

Seconds

NX_MSECONDS

1000

Milliseconds

NX_USECONDS

1000000

Microsecond

NX_NSECONDS

1000000000

Nanoseconds

time

(OUT) Points to the location to be set to the returned time. This is a 64-bit entry on all the platforms on which NKS will be hosted.

Return Values

If successful, returns zero. Otherwise, returns the following:

Decimal

Hex

Constant

Description

9

0x09

NX_EINVAL

Invalid specification of epoch or granularity

Remarks

NXGetTime returns values that are unified across multiple processors. Except for seconds since the Epoch, calendar time calculations are not part of the NKS specification.