How to measure volume

I need a way to measure volume with the arduino, so that when it reaches that volume, it stops doing what its doing.
The thing is I need to measure the volume constantly, so that when it reaches a certain volume, it measures another volume.
I was told that this could be done by measuring the pressure of the water, but I don't know how to do this.
Please tell me how to measure volume constantly with the arduino, so that when it reaches a certain volume, it stops doing what its doing.
Thanks in advance!

I would probably put some sort of light sensor at the level of the desired volume. I assume its a liquid.
What I would do is use an IR beam and a sensor, theres another thread going about IR beam break.
This is essentially the same idea.
If the liquid is in a beaker, then the IR beam would be able to go through the glass and the sensor could pick it up at the same height on the other side,
once the water or liquid reached that height, the IR beam wouldn't be hitting the beam because the light will be diffracted....theoretically.
Granted the diffraction won't be much if you are using a thin container at the desired height volume, I would recommend using a wide mouth or where ever the volume is at to make sure that there's plenty of liquid to diffract the IR beam.

I bet theres another way to do it although thats how I would do it. I wonder if anybody else has a better idea.

I think this would not work, because I need to irrigate plants with this amount of water, so what I need to do is measure the amount of volume being used, but without putting it into a container or tank that can hold the amount of water, I need to measure the volume coming out of the faucet.
Can someone please tell me how to do this?
Thanks in advance!

Ah! so the water supply is hooked up to the tap or some other thing that isn't a water tank.
you could have it be poured into a container and whatever is holding up the container will go down b/c of the weight and then there will be a scale measuring that and then the water is poured out of it by tilting it, you could have a grate right about the plant so it wouldn't just dump it on the plant.

Can I use a transducer to measure the pressure exerted by the water in the faucet and then calculate the volume with that pressure, so I don't have to put the water into a container to measure its volume, before doing what I need to do with it?
If this can be done, how can I do it? Can you give me a tutorial I could follow to do this?
Thanks in advance!

If I understand it right, what you asking about is flow meter - device that measure liquid amount .
Google returns plenty of links for "flow meter arduino"

Here's an pretty well documented option.

And here complete project:
http://www.practicalarduino.com/projects/water-flow-gauge

^^^^boom baby