Package 

Class JavaTimerManager


  • 
    public class JavaTimerManager
    
                        

    This class is the native implementation for JS timer execution on Android. It schedules JS timers to be invoked on frame boundaries using ReactChoreographer.

    This is used by the NativeModule TimingModule.

    • Method Detail

      • createTimer

         void createTimer(int callbackID, long delay, boolean repeat)

        A method to be used for synchronously creating a timer. The timer will not be invoked until thenext frame, regardless of whether it has already expired (i.e. the delay is 0).

        Parameters:
        callbackID - An identifier for the callback that can be passed to JS or C++ to invoke it.
        delay - The time in ms before the callback should be invoked.
        repeat - Whether the timer should be repeated (used for setInterval).
      • createAndMaybeCallTimer

         void createAndMaybeCallTimer(int callbackID, int duration, double jsSchedulingTime, boolean repeat)

        A method to be used for asynchronously creating a timer. If the timer has already expired,(based on the provided jsSchedulingTime) then it will be immediately invoked.

        Parameters:
        callbackID - An identifier that can be passed back to JS to invoke the callback.
        duration - The time in ms before the callback should be invoked.
        jsSchedulingTime - The time (ms since epoch) when this timer was created in JS.
        repeat - Whether the timer should be repeated (used for setInterval)