Hi Majit,
The best option for you is to join a Gym to prepare youself for the Marathon. You can take care of the distance covered and time taken on the treadmill.