"Matsya Purana (2.25-30) gives an account of initial creation. After Mahapralaya, the great dissolution of the Universe, there was darkness everywhere. Everything was in a state of sleep. There was nothing, either moving or static. Then Svayambhu, Self-manifested Being arose, which is a form beyond senses. It created the primordial waters first and established the seed of creation into it. The seed turned into a golden womb, Hiranyagarbha. Then Svayambhu entered in the egg, and it is called Vishnu because of entering. Brahmanda Purana (1.4.25) says that it is called as Vishnu because it pervades the whole Universe." (Wikipedia - Hiranyagarbha)
For a large majority of hindus, Vishnu is the Supreme God, therefore, he was around all the time. But then, other people may consider the Mother Goddess Durga or Shiva as the Supreme God or Goddess. There are many stories.