Check out example codes for "processing deltatime". It will help you in understanding the concepts better.

Code Example 1

float deltaTime;
long time;

void setup(){
  // do your setup stuff...
  time = millis();
}

void draw(){
  long currentTime = millis();
  // get deltaTime in seconds.
  deltaTime = (currentTime - time) * 0.001f;

  // do your drawing stuff...

  //Update time in preparation for next frame.
  time = currentTime;
}

Learn ReactJs, React Native from akashmittal.com