All pastes #2118237 Raw Edit

Miscellany

public text v1 · immutable
#2118237 ·published 2012-02-12 13:02 UTC
rendered paste body
// Elapsed Time
                // Keep rollover in mind and /4 cause the value is transmitted in 0.25s
                int time = response.messageContents[3] / 4;
                if (roundtime && time < 10)
                {
                    itime += 64;
                    roundtime = false;
                } // reset boolean
                else if (!roundtime && time > 50)
                {
                    roundtime = true;
                }

                time += itime;

                // to timevalue
                TimeSpan t = TimeSpan.FromSeconds(time);
                timestring = string.Format("{0:D2}:{1:D2}", t.Minutes, t.Seconds);

                updateElapsedTime(timestring + " sec");