NVIDIA DriveOS Linux SDK API Reference

7.2.5.0 Early Access Release

Detailed Description

Data Structures

struct  NvOsSystemTime
 System Time Structure. More...
 

Functions

NvError NvOsGetSystemTime (NvOsSystemTime *hNvOsSystemtime)
 This function gets the current time as seconds and milliseconds. More...
 
NvU32 NvOsGetTimeMS (void)
 This function returns the current time as millisecond. More...
 
NvU64 NvOsGetTimeNS (void)
 This function gets the current time as nanosecond. More...
 
NvU64 NvOsGetTimeUS (void)
 This function returns the current time as microsecond. More...
 

Function Documentation

◆ NvOsGetSystemTime()

NvError NvOsGetSystemTime ( NvOsSystemTime *  hNvOsSystemtime)

This function gets the current time as seconds and milliseconds.

Parameters
[out]hNvOsSystemtimeA pointer of structure NvOsSystemTime
Returns
NvSuccess Success
NvError_BadParameter Error if hNvOsSystemtime parameter is NULL
NvError_NotImplemented Error if error is return from gettimeofday()
NvError_OverFlow Error if the time is overflow in QNX libc
Precondition
None


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: Yes
    • Thread-safe: Yes
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: Yes
    • Reinit/Deinit Preparation: Yes
  • Maturity: GA

◆ NvOsGetTimeMS()

NvU32 NvOsGetTimeMS ( void  )

This function returns the current time as millisecond.

Returns
Current time as millisecond
Precondition
None


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: Yes
    • Thread-safe: Yes
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: Yes
    • Reinit/Deinit Preparation: Yes
  • Maturity: GA

◆ NvOsGetTimeNS()

NvU64 NvOsGetTimeNS ( void  )

This function gets the current time as nanosecond.

Returns
Current time as nanosecond
UINT64_MAX in the error cases that System clock is read as 0 or the result of getting time exceeds the valid boundary.
Note
The time resolution depends on the frequency of ARM counter. The minimum interval between two consecutive calls of this function is
  • For T23x, it is 32 ns (freq = 31.25MHz)
  • For T26x, it is 10 ns (freq = 1GHz)
    • Even though the increment rate is 1GHz, the counter is updated at the frequency of 108MHz (i.e. updated every 9~10 increments). If the function is called twice within the minimum interval above, it returns the same time value.
Precondition
None


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: Yes
    • Thread-safe: Yes
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: Yes
    • Reinit/Deinit Preparation: Yes
  • Maturity: GA

◆ NvOsGetTimeUS()

NvU64 NvOsGetTimeUS ( void  )

This function returns the current time as microsecond.

Returns
Current time as microsecond
UINT64_MAX in the error cases that System clock is read as 0.
Precondition
None


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: Yes
    • Thread-safe: Yes
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: Yes
    • Reinit/Deinit Preparation: Yes
  • Maturity: GA