HELP using two HC-SR04 simultaneously to determine direction

Hi everyone!
I'm doing a project and in it, I need to know whether someone entered the room or had exited.
in order to do that, I thought about using two ultrasonic distance sensors (HC-SR04) and if the distance gets shorter on the first sensor first the person entered the room and if the distance gets shorter on the second sensor first the person has left.
But the problem that I have is that I am very new to Arduino and not sure how to code for two sensors at the same time.
If anyone can give me some guidance it would be VERY appreciated!
Thanks in advance!
PS: please don't mind my grammar English is not my first language

You can't really have 2 rangefinders (RF) pinging at the same time and get meaningful data. A RF does not know the difference between the echo that it receives from pulse that it send, from an echo from a pulse that a different RF sent. So after RF a sends and receives an echo there needs to be enough delay before firing RF b to let the echo from RF a die down and so on.

Detecting (counting) people entering leaving a room is not an uncommon question on this forum. I have never seen a method, using Arduino and common sensors*, that has anywhere near 100% accuracy. It is actually a pretty difficult thing to do.

*ultra sound, IR gates, motion sensors, etc.

groundFungus:
It is actually a pretty difficult thing to do.

I think to be anywhere near reliable it needs a turnstile.

elvon_blunden:
I think to be anywhere near reliable it needs a turnstile.

Only as reliable as the supervisor that makes sure children don't simply crawl under it, or adults jump over it...

One of our local bus companies is currently trying to do an experiment where a big display on the lower deck gives the number of available seats on the upper deck. I don't know what sensors they use (I guess IR based - the sensor next to the stairway is a ~15 cm long black bar about knee height above the steps), but it doesn't seem to work very well so far... and that's while it's guaranteed limited to one person at a time passing (except for small children that are carried, but those shouldn't take a seat in the first place), as it's so narrow a passage.

It's a pretty hard thing to do reliably. Using ultrasound won't make it any easier. I'd opt for some kind of break beam sensors.

wvmarle:
Only as reliable as the supervisor that makes sure children don't simply crawl under it, or adults jump over it...

Can't get over or under one of these guys:

People still can get in two at a time. Especially smaller folk, such as children. OK if you deploy it in the US that'd probably not happen, but the other half of the population wouldn't be able to pass through at all...

wvmarle:
People still can get in two at a time.

I'm as skinny as it gets, and can barely get into some of those alone.

wvmarle:
OK if you deploy it in the US that'd probably not happen, but the other half of the population wouldn't be able to pass through at all...

I have no idea what that means, but suspect it's insulting.