arduino determining order sensors are activated

Hello, this is my first post.

I am doing a project where I have 2 proximity switches that give a "false" when an object is within range. They will be positioned in a sequence where the order in which they go false will determine what direction the object is travelling. What is the best way to go about solving a problem like this?

Thanks in advance.

One method is to store a timestamp when each sensor is activated, by saving the return value of either milliis() or micros(), then subtract or compare.

Don't forget to declare time values as unsigned long int.

thanks will give it a try! appreciate the help.

There may be an "easier" way than recording times. But it depends on the application and the situation. How many objects are "in play" at any instant? Could one object enter from one direction, triggering the first sensor. Then, before the first object triggers the second sensor, could a second object enter, coming in the same direction and triggering the same sensor, or from the opposite direction and triggering the other sensor? Things could get very confusing!