The following sections outline advanced usage topics not needed for normal operation of the library.
Other supported tracers
Tuning Fork supports multiple tracers. Tracers with the following instrument keys are supported:
- Time between frame starts (called
- CPU Time: Time between the start of the frame and the end of the CPU work
for the frame (called
- GPU Time: Time for the previous frame to be handled by the GPU (called
- The raw frame time, defined as the maximum of the CPU and GPU time (called
RAW_FRAME_TIME). The difference between this option and
PACED_FRAME_TIMEis that this option does not include any wait time included by Swappy or VSync.
You can find these instrument keys in the reference documentation. Some of these keys are used automatically when you enable the Android Frame Pacing library, but if you are not enabling this library, you should use them explicitly.
Get fidelity parameters
If you pass
TuningFork_init in settings or the
library is in scaled mode, you do not need to call this function.
This function contacts a server to retrieve fidelity parameters. It blocks until one of the following occurs:
- Fidelity parameters are retrieved, with a return value of
returnedParamsstore the parameters. In this case, all subsequent tick data is associated with
- A number of milliseconds equal to
timeout_mspasses, with a return value of
TFERROR_TIMEOUT. In this case, all subsequent tick data is associated with
You must call
TuningFork_init() before this function, and you must call it on
a separate thread from the main thread (see
for a utility function that does this for you). You can call this function
again, for example at level-loading time, to retrieve fidelity parameters from
the server again. This allows you to dynamically update parameters rather than
having to reload them only at start-up. If new fidelity parameters are
downloaded or a new default is used, all previous tick data is submitted.