SR-04 data to TFT under touch screen button

Hi,

I am trying to calculate passed time between two ultrasonic readings (ultrasonic values 15 and 35). So far i get only value 0.
Sensor is attached to a fixed moving bar, which goes up and down, and i want to calculate the time of the upward movement after button1 has been pressed.

#include "RBD_Timer.h"
#include <LCDTFT.h>
#include <LCDTP.h>
#include "font.h"
#include "button.h"
#include "SPI.h"
#include <Ultrasonic.h>

#define backcolor 0xFFFF
#define  DELAY_START   >15       // or low depending on your blink detection logic
#define  DELAY_END   >35   // this is the inverse of the above 
TFTLCD TFT;
Ultrasonic ultrasonic(7,4);
RBD::Timer timer;
//Font class object is font
Font  font;
long start, duration;
//Touchuscreem TP class object is tp
TP tp;
//Two Button class object is  Button1,Button2
Button  Button1,Button2,Button3,Button5,Button6,Button7,Button8;
void setup()
{
  //TFT initialization
   TFT.begin();
   analogWrite(6, 255);
   Serial.begin(115200);
   timer.setTimeout(3000);
   //LCD Clear the screen, backcolor
   TFT.clear(backcolor);
   Serial.begin(9600);  
   Serial.print(ultrasonic.Ranging(CM));
   //Set the text area for the upper left corner (10, 10), the lower right corner (200,200), if the color is NULL or R0 G0 B0(black), is also not set text color 
   font.set_txt(10,10,200,100,TFT.RGB_TO_565(255,255,255));
   
   //Set the text font color
   font.set_fontcolor(TFT.RGB_TO_565(0,0,255));
   //Displays a string

   
   //To modify the button size
   Button1.resetsize(100,100);
   //Draw the first round button1
   Button1.drawButton(5,130,1,"Testit");
  
 
   Button2.resetsize(100,100);
   Button2.drawButton(110,130,1,"Harjoitus");
  
   Button3.resetsize(100,100);
   Button3.drawButton(215,130,1,"Asetukset");
   
   

}

void loop()
{
  
       
       //check Touch current state detection
      tp.pen_down();
     
      //The touch screen is touch
      if(tp.flag&&tp.y_val&&tp.x_val)
      {
        //Check whether pressing the first button
     if (Button1.istouch(tp.x, tp.y))
      {

        TFT.clear(backcolor);
        font.set_txt(10, 10, 200, 100, TFT.RGB_TO_565(255, 255, 255));
        font.set_fontcolor(TFT.RGB_TO_565(0, 0, 255));
        font.lcd_string("Odotetaan..");
        float mitta1 = (ultrasonic.Ranging(CM));
        
       
     
         if(mitta1>15)  ;
        timer.restart();
         
         if(mitta1>35);
        int duration = timer.getValue();

      
       
       font.set_txt(200, 10, 100, 100, TFT.RGB_TO_565(255, 255, 255));
       font.set_fontcolor(TFT.RGB_TO_565(0, 0, 255));
       font.lcd_int(duration);
       
        Button1.resetsize(100, 100);
        Button1.drawButton(5, 130, 1, "Nollaa");
        Button2.resetsize(100, 100);
        Button2.drawButton(110, 130, 1, "Harjoitus");
        Button3.resetsize(100, 100);
        Button3.drawButton(215, 130, 1, "Asetukset");
       
       }
      }    
}