ITimeU.Controllers.TimerController.GetStartruntimeForSpeaker C# (CSharp) Method

GetStartruntimeForSpeaker() private method

private GetStartruntimeForSpeaker ( int raceid ) : System.Web.Mvc.ActionResult
raceid int
return System.Web.Mvc.ActionResult
        public ActionResult GetStartruntimeForSpeaker(int raceid)
        {
            var race = RaceModel.GetById(raceid);

            TimerModel timer = null;
            if (race.GetTimerId().HasValue)
                timer = TimerModel.GetTimerById(race.GetTimerId().Value);
            DateTime starttime;
            int runtime = 0;

            if (timer.StartTime.HasValue)
            {
                starttime = timer.StartTime.Value;
                var ts = DateTime.Now - starttime;
                runtime = (int)ts.TotalMilliseconds;
            }
            return Content(runtime.ToString());
        }