for the speedrunning, you could store the current time as a new variable every time you hit a checkpoint, and then on respawning set the timer back to the time you hit the checkpoint. or some might say a large part of speedrunning is avoiding dying in the first place to get the best time possible.