You enter Switzerland when going into the main building. The passport check, if it takes place at all, takes anything between 5-15 min. If you are on a direct train from France into Switzerland, the passport checks take place in the train. The procedure shouldn't last more than a few minutes.