Just calculate the difference between Exam start time and end time using session and DateTime Subtract function. On Start button you can set session with current time.
Session["ExamStartTime"] = DateTime.Now.ToString();
And on EndTime you can set check the difference based on current time and Session Stored Time.
TimeSpan diffrence = DateTime.Now.Subtract(Convert.ToDateTime(Session["ExamStartTime"]));
string totaltime = string.Format("{0}:{1}:{2}", diffrence.Hours.ToString().PadLeft(2, '0'), diffrence.Minutes.ToString().PadLeft(2, '0'), diffrence.Seconds.ToString().PadLeft(2, '0'));