Decoherence time and spin measurement in the Stern-Gerlach experiment