nn::os::Tick Classclass Tick
Class for handling system ticks.
A system tick represents a single clock cycle of the CPU. The conversion constructors and conversion operators let you convert from ticks to nn::fnd::TimeSpan objects (which represent actual time), and vice versa. Use GetSystemCurrent to get the number of ticks that have occurred since the system was started up.
There are individual differences, and the system tick can vary widely by temperature, so the precision is somewhere around ±300 seconds per month. This value is not something that can be guaranteed in the retail product.
Time in terms of current date and time as gotten by the nn::fnd::DateTime::GetNow function progresses at a different speed, so the two values must not be used in combination. Even though you get values in the same unit with the nn::os::Tick::ToTimeSpan function, you do not get the same value even when you take the measurement at the same time.
Also, in most cases, time progresses at different rates in libraries that handle time internally (for example, for streaming playback of audio and video). So, for example, if you want to synchronize the application's gameplay with the sound playback, you need to understand the specifications for the individual libraries and use the same rate of time progression for both.
| S |
TICKS_PER_SECOND
|
const s64 | Constant representing the number of ticks per second. |
|---|
| Constructor | ||
|---|---|---|
Tick
|
Constructor that takes a number of ticks and initializes an object. | |
| S |
GetSystemCurrent
|
Returns the number of ticks that have occurred since the system was started up. |
| Conversions | ||
operator s64
|
Converts to a 64-bit tick value. | |
operator nn::fnd::TimeSpan
|
Converts to a nn::fnd::TimeSpan value. |
|
ToTimeSpan
|
Converts to a nn::fnd::TimeSpan value. |
|
| Sums and Differences | ||
operator-=
|
Subtracts a tick value. | |
operator-
|
Finds the difference between tick values. | |
operator+=
|
Adds a tick value. | |
operator+
|
Finds the sum of tick values. | |
| Conversion to Second Units | ||
ToNanoSeconds
|
Converts to nanosecond units. | |
ToMicroSeconds
|
Converts to microsecond units. | |
ToMilliSeconds
|
Converts to millisecond units. | |
ToSeconds
|
Converts to second units. | |
nn::fnd::DateTime::GetNow is prohibited, and added a description of precision.CONFIDENTIAL