public void StartTimer()
        {
            DoAfterUpdate(() =>
            {
                if (IsRunning)
                {
                    return;
                }

                ResetTimer();
                _stopwatch.Start();
                RunLog.StartDate = _stopwatch.StartDate;
            });
        }
Example #2
0
        /// <summary>
        /// Offsets relative to the last beat
        /// </summary>
        /// <param name="millisecondsOffset"></param>
        /// <param name="quarterBeatsOffset"></param>
        public void StartTimer(int millisecondsOffset = 0, int quarterBeatsOffset = 0)
        {
            var beatTime = new BeatTime(_beatTimer.Bpm, quarterBeatsOffset, millisecondsOffset);

            DoAfterUpdate(() =>
            {
                if (IsRunning)
                {
                    return;
                }

                ResetTimer();
                _speedrunStopwatch.Start((int)beatTime.Milliseconds);
                _beatTimer.StartTimer(millisecondsOffset, quarterBeatsOffset);
                RunLog.StartDate = _speedrunStopwatch.StartDate + beatTime.TimeSpan;

                if (LiveSplitSyncEnabled)
                {
                    _liveSplitSync.Start();
                }
            });
        }