IF does not work in code

First of it is very unreasonable to bump your Thread after just 7 hours. 48 hours would be reasonable.

You need to use the AutoFormat tool to indent your code consistently - it will make it much easier to read.

I can't figure out what delay() you are referring to - that you want to set at 1 msec.

In general if you want a responsive program you should not use delay() at all as it blocks the Arduino from doing other things. Use millis() to manage timing as illustrated in Several Things at a Time.

If all you want to do is figure out the difference in time between the pressing of one sensor and another sensor I suspect a much shorter program would be sufficient. Something like this pseudo code

void loop() {
    read and save SensorA and save the value of micros()
    if sensAvalue > threshold
       that value of micros = startTime
       note that you have a start value
    read and save SensorB and save the value of micros()
    if sensBvalue > threshold
       that value of micros = endTime
       note that you have an endTime
    if you have an endTime and a startTime
       calculate the difference
}

...R