What do you have to do to find the origin time of an earthquake?

i remember it had something to do with p-waves and subtracting..