OSTicksToNanoseconds

Syntax

#include <cafe/os.h>

#define OSTicksToNanoseconds(ticks) ((((u64)(ticks)) * 32000ULL) / ((u64) OS_TIMER_CLOCK / 31250))

Parameters

ticks Set to OSTime (64-bits) or OSTick (32-bits) type integer value.

Return Values

Time in nanoseconds.

Description

Converts time from ticks (at OS_TIMER_CLOCK Hz) to nanoseconds.

NOTE:
  • Nanoseconds 64-bit conversion overflow occurs approximately every 107 days.
  • This function should not be used to determine long durations such as wall clock time. It is intended to be used for short durations because it is subject to truncation in approximately n days. See OSTicksToCalendarTime.

Do Not Call From

None.

See Also

OSTicksToCycles
OSTicksToSeconds
OSTicksToMilliseconds
OSTicksToMicroseconds
OSSecondsToTicks
OSMillisecondsToTicks
OSMicrosecondsToTicks
OSNanosecondsToTicks

Revision History

2013-05-08 Automated cleanup pass.
2012-08-01 Cleanup Pass
2012-05-25 Match actual header.
2010-08-30 Initial version.


CONFIDENTIAL