How Long Was Mars Geologically Active For?

Looking at the photos of the surface, you can clearly see layers of sedimentary rock, and sand and boulders. this tells us that mars had a period of mountain building and erosion, with glaciers which ground the mountains down. If life began on Mars, would there be sufficient time for fossils of its ancient life to form?